Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure extension installs permanently for Firefox #656

Closed
markmhendrickson opened this issue Nov 2, 2020 · 18 comments
Closed

Ensure extension installs permanently for Firefox #656

markmhendrickson opened this issue Nov 2, 2020 · 18 comments

Comments

@markmhendrickson
Copy link
Collaborator

The extension install instructions indicate that the user should use the "Load Temporary Add-on…" option in Firefox to install the extension from source. However, this appears to result in the extension getting removed automatically upon reload of Firefox each time.

Kapture 2020-11-02 at 14 44 23

If I alternatively try to use the "Install Add-on from file" option, it doesn't recognize any of the files for selection:

Kapture 2020-11-02 at 14 46 36

If I try to zip the "dist" folder and upload, it says it's corrupt:

Screen Shot 2020-11-02 at 14 46 21

Furthermore, before restarting Firefox, Blockstack apps don't appear to detect the extension during authentication anyway. I'm still getting redirected to the hosted version where I'm prompted to "Get the Firefox extension":

Kapture 2020-11-02 at 14 41 00

@markmhendrickson
Copy link
Collaborator Author

@timstackblock can you confirm the same behavior on your end here?

@timstackblock
Copy link
Contributor

@markmhx Is this with the latest refactored extension version that is in test or the prod extension version?

@markmhendrickson
Copy link
Collaborator Author

Prod extension version

@timstackblock
Copy link
Contributor

timstackblock commented Nov 2, 2020

Yup that one is broken your videos are exactly what I was seeing. It should be fixed in the executable on @hstove latest PR, not sure if its merged into master yet.

@markmhendrickson markmhendrickson self-assigned this Nov 3, 2020
@markmhendrickson
Copy link
Collaborator Author

markmhendrickson commented Nov 4, 2020

I'm getting the following Can't resolve '@stacks/connect-ui' error when I try to run yarn prod:ext per the instructions with the latest code merged into master.

@timstackblock mind seeing if you can recreate from source?

$ yarn prod:ext
yarn run v1.22.4
$ cross-env NODE_ENV=production EXT_ENV=prod webpack -p --config webpack-ext.config.js
Starting type checking service...
clean-webpack-plugin: pausing due to webpack errors
Hash: c58187562689fea124cc
Version: webpack 4.43.0
Time: 3033ms
Built at: 11/04/2020 2:56:24 PM
 4 assets
Entrypoint background = background.js
Entrypoint inpage = inpage.js
Entrypoint message-bus = message-bus.js
Entrypoint index = index.js
[072K] ./src/common/dev/store.ts 53 bytes {1} [built]
[2YZa] ./src/index.tsx 885 bytes {1} [built]
[7ets] ./src/extension/inpage.ts 3.47 KiB {3} [built]
[9KIl] ./src/store/onboarding/types.ts 1.83 KiB {1} {2} [built]
[BhN1] ./src/store/index.ts 1.02 KiB {1} {2} [built]
[IPBg] ./src/extension/content-scripts/message-bus.ts 858 bytes {0} [built]
[Kack] ./src/store/transforms.ts 2.33 KiB {1} {2} [built]
[QKQq] ./src/common/hooks/use-message-pong.ts 905 bytes {1} [built]
[Vn5Y] ./src/store/onboarding/reducer.ts 2.65 KiB {1} {2} [built]
[cZO5] ../connect/src/index.ts 127 bytes [built]
[iCcP] ./src/store/ext-store.ts 2.3 KiB {1} {2} [built]
[kiQV] ./package.json 4.79 KiB {1} [built]
[nUtP] ./src/extension/background.ts 554 bytes {2} [built]
[t06s] ./src/common/utils.ts 5.43 KiB {0} {1} [built]
[tWL+] ./src/common/track.ts 6.64 KiB {1} [built]
    + 947 hidden modules

ERROR in ../connect/src/ui.ts
Module not found: Error: Can't resolve '@stacks/connect-ui' in '/private/var/www/ux/packages/connect/src'
 @ ../connect/src/ui.ts 8:0-58 10:2-22
 @ ../connect/src/index.ts
 @ ./src/common/utils.ts
 @ ./src/extension/content-scripts/message-bus.ts
Child HtmlWebpackCompiler:
     1 asset
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    [Z3W6] /private/var/www/ux/node_modules/html-webpack-plugin/lib/loader.js!./public/html/index.html 521 bytes {0} [built]
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@timstackblock
Copy link
Contributor

@markmhx when did stacks.js get merged into the connect master branch without passing through QA stacks.js was only tested on the devX side in the TODOs app and the CLI this was never tested with connect or the authenticator for any build that came through the UX team. I am pretty sure thats why we have errors on that branch.

@timstackblock
Copy link
Contributor

Looks like #624 was merged on Monday, I definitely didn't QA this on Monday before the merge, I can take a look now.

@markmhendrickson
Copy link
Collaborator Author

@hstove to provide latest command guidance

@hstove
Copy link
Contributor

hstove commented Nov 4, 2020

You need to run yarn lerna run build --scope @stacks/connect-ui

@markmhendrickson
Copy link
Collaborator Author

@hstove the above command doesn't appear to generate a dist directory for me

@hstove
Copy link
Contributor

hstove commented Nov 10, 2020

Correct - the above command must be run first, and then run yarn lerna run prod:ext

@markmhendrickson
Copy link
Collaborator Author

I was able to install from source for Firefox and authenticate successfully with the modified instructions provided by @hstove above:

git clone https://github.com/blockstack/ux && cd ux
yarn
cd packages/app 
yarn lerna run build --scope @stacks/connect-ui
yarn lerna run prod:ext

image

However, I still can't use the "Install Add-on from file" option to install the extension permanently (it shows the same "appears to be corrupt error if I zip the dir directory as before). And it keeps going away upon browser restart if I use "Load Temporary Add-on…".

@hstove ideas on how to install the extension permanently from source for Firefox here?

@markmhendrickson markmhendrickson changed the title Fix problems with extension build for Firefox Ensure extension installs permanently for Firefox Nov 23, 2020
@markmhendrickson markmhendrickson added this to Stacks Wallet (Mainnet) in 🧊 UserX Icebox Nov 23, 2020
@markmhendrickson markmhendrickson moved this from Stacks Wallet (Mainnet) to Connect 2.0 in 🧊 UserX Icebox Nov 23, 2020
@markmhendrickson
Copy link
Collaborator Author

I tried the above instructions for building the extension on a new device but ran into a lerna error when running inside packages/app:

yarn lerna run build --scope @stacks/connect-ui
yarn run v1.3.2
(node:13747) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
error Command "lerna" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@hstove any ideas?

@markmhendrickson
Copy link
Collaborator Author

yarn was getting called in the wrong directory. I've submitted a fix to the instructions here: #700

@hstove
Copy link
Contributor

hstove commented Dec 11, 2020

Hey - did some looking into this. In order to permanently install an extension in Firefox, the extension has to be signed. Fortunately, this is not too tricky - Mozilla provides a nice CLI. #703 added a new Github Action that creates this signed extension (called an .xpi file). So, you can go to a PR (try #703), click the link to "view latest builds" in the PR description, and then download the artifact from there.

This is actually the first step towards self-hosting - as that .xpi is what we'd distribute. But for now, this is better for beta testing.

@markmhendrickson
Copy link
Collaborator Author

Sounds great. Does this change require any updates to the build and install instructions re: #700?

@markmhendrickson markmhendrickson added enhancement and removed bug Functionality broken labels Jan 4, 2021
@markmhendrickson markmhendrickson removed this from Stacks Wallet (Web) in 🧊 UserX Icebox Apr 13, 2021
@stale
Copy link

stale bot commented Jul 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 3, 2021
@stale
Copy link

stale bot commented Jul 11, 2021

This issue has been automatically closed. Please reopen if needed.

@stale stale bot closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants