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

fix extension loading error in chrome extension #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

allenyllee
Copy link

@allenyllee allenyllee commented Jul 9, 2021

Hi @0x6b , very thank you for developing this extension, I used it a lot in Firefox.
But after I switch to Brave browser (chrome-based), it's a long waited for its chrome version.
So when I see #50 closed, this extension has been ported to chrome, I can't wait to build it by myself.
Follow #95's instruction, I've built it successfully, but I met some error when I loading this extension.
So I try to fix these errors and now it worked perfectly!

This pull request fix these errors, which almost all are path issue, except the last one, which is permission issue.

In order to dynamically remove hosts permission, we need to create "optional_permissions" key and move "<all_urls>" into that key. see: https://developer.chrome.com/docs/extensions/reference/permissions/#step-2-declare-optional-permissions-in-the-manifest

@0x6b
Copy link
Owner

0x6b commented Jul 26, 2021

@allenyllee thank you for your time for the PR. Can you please check the following steps before loading locally-built extension?

  1. Clone the repository
  2. Install dependencies (npm i)
  3. Build core and extensions (npm run build)
  4. Load packages/chromium/dist/manifest.json as unpacked extensions to your browser

I guess you loaded packages/chromium/manifest.json at step 4 thus failed to load .js files due to wrong path. Permission change (64ae6ed) could be valuable but other two commits may not be needed I'm afraid. Sorry for lack of the build instruction for Chromium based browsers. Please get back to me how the steps above work for you. Thanks!

@allenyllee
Copy link
Author

OK, I see...
Previously, I copy the whole packages/chromium/ folder and load it, didn't aware that it just need to copy packages/chromium/dist/ folder.

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

Successfully merging this pull request may close these issues.

2 participants