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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support safari webextensions in runtime-js #8141

Closed
Kjoep opened this issue May 25, 2022 · 2 comments 路 Fixed by #8175
Closed

Support safari webextensions in runtime-js #8141

Kjoep opened this issue May 25, 2022 · 2 comments 路 Fixed by #8175

Comments

@Kjoep
Copy link
Contributor

Kjoep commented May 25, 2022

馃檵 feature request

Runtime-js currently has specific support for chrome and firefox extensions. It has logic to generate a url relative to the bundle root. For Safari this logic is missing, and parcel generates non-functional URLs. (could be considered a bug, depending on how you look at it)

馃 Expected Behavior

When accessing assets in a safari extension, URLs should be formed correctly by getBundleUrl/getBaseUrl/getOrigin.

馃槸 Current Behavior

URLs generated by getBundleUrl/getBaseUrl/getOrigin do not get transformed and are not generally resolvable in a safari extension.

馃拋 Possible Solution

Adapt the regex in bundle-url.js to also support safari extensions.
I wrote a fix here: 6b82317

@101arrowz
Copy link
Member

101arrowz commented May 25, 2022

Feel free to make a PR with that commit! We have only tested that regex on Chrome and Firefox extensions, but I think pretty much every major browser beyond Firefox uses Chromium at this point so they all use chrome-extension. I guess Safari made their own implementation though.

@Kjoep
Copy link
Contributor Author

Kjoep commented May 31, 2022

Hi @101arrowz . A PR is here: #8175 Let me know if I did it wrong ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants