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

Question about webextension-polyfill insertion using content-script #106

Closed
BoQsc opened this issue Apr 10, 2018 · 2 comments
Closed

Question about webextension-polyfill insertion using content-script #106

BoQsc opened this issue Apr 10, 2018 · 2 comments

Comments

@BoQsc
Copy link

BoQsc commented Apr 10, 2018

If, this polyfill is inserted into every webpage using content-script, could it break other extensions that do not use or are aligned to webextension-polyfill? For example - in a chrome browser?

@Rob--W
Copy link
Member

Rob--W commented Apr 10, 2018

This polyfill should not be inserted in a web page because there are no WebExtension APIs in a web page. You will not get a cross-browser-compatible extension if you try to use a chrome. or browser. API from a web page.

The polyfill is a no-op when the browser global is detected, so in theory there won't be conflicts if multiple extensions use the polyfill in a web page. But I recommend to not use the polyfill in a web page for the above reason (and to minimize impacts on the page itself. E.g. if the page has a browser variable, then your extension will break anyway).

@BoQsc
Copy link
Author

BoQsc commented Apr 10, 2018

So, just to be more clear: as long as declaring this polyfill inside extension's manifest will inject the polyfil into Isolated World that has access only to the page elements. polyfill Injection actually has no effect on the other extensions that are running.

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

2 participants