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: Improve extraHeaders feature detection #787

Merged
merged 1 commit into from
Oct 11, 2019
Merged

Conversation

sammacbeth
Copy link
Contributor

On Firefox forks the runtime.isFirefox detection will fail (because the browser name is not 'Firefox'). This leads to an error when registering webRequest listeners as the extraHeaders option is not needed, preventing the extension from loading.

There is actually an extension API that can be used to detect support for this option: OnBeforeSendHeadersOptions.

This PR updates the feature detection check to explicitly look for this API. We have to also check to for the presence of OnBeforeSendHeadersOptions as it does not exist on Edge.

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you!

@lidel lidel changed the title Improve extraHeaders feature detection fix: Improve extraHeaders feature detection Oct 11, 2019
@lidel lidel merged commit e037f0a into ipfs:master Oct 11, 2019
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