Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@omar-azmi
Copy link
Owner

this commit fixes the issue with firefox's dynamic importation problem: Support Firefox #3.

  • add content_script_extension_adapter.ts, which now takes the role of being the actual loaded content_script, and it dynamically imports content_script.ts through the use of browser.runtime.getURL, which is the only acceptable way of importing in firefox, as firefox does not allow the use of relative url constant string import. the imported url has to be absolute.
  • make content_script.ts import statically, since dynamic import is no longer required by it, as it is no longer the direct entry point of the actual content_script.
    • this also reduces our code-splitting-chunk output files from 3 to just 1
  • in manifest.json:
    • reduce the web_accessible_resources matches url to just github, since we do not want other websites to be able to fetch GET and sniff our ".js" files from untrusted domains, should they somehow be able to figure out our extension's UUID.
    • add browser_specific_settings, which is the only way to get storage access permission in firefox when it is loaded as a development extension. I don't know if this key is necessary for publication though.

…m: Support Firefox #3.

- add `content_script_extension_adapter.ts`, which now takes the role of being the actual loaded `content_script`, and it dynamically imports `content_script.ts` through the use of `browser.runtime.getURL`, which is the only acceptable way of importing in firefox, as firefox does not allow the use of relative url constant string import. the imported url has to be absolute.
- make `content_script.ts` import statically, since dynamic import is no longer required by it, as it is no longer the direct entry point of the actual `content_script`.
  - this also reduces our code-splitting-chunk output files from 3 to just 1
- in `manifest.json`:
  - reduce the `web_accessible_resources` matches url to just github, since we do not want other websites to be able to fetch `GET` and sniff our `".js"` files from untrusted domains, should they somehow be able to figure out our extension's UUID.
  - add `browser_specific_settings`, which is the only way to get storage access permission in firefox when it is loaded as a development extension. I don't know if this key is necessary for publication though.
@omar-azmi omar-azmi merged commit da74b30 into main Feb 6, 2024
@omar-azmi omar-azmi deleted the firefox-fix1 branch February 6, 2024 03:43
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