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

Improve filterResponseData #110

Merged
merged 5 commits into from
Mar 22, 2019
Merged

Conversation

gbaptista
Copy link
Owner

@gbaptista gbaptista commented Mar 21, 2019

Rely on the content_type of the request to decide if the code should be injected with filterResponseData:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types

Examples:

text/html > inject
application/xhtml+xml > inject
text/plain > don't inject
image/svg+xml > don't inject

Do not inject scripts into non-html documents for Chrome and old versions of Firefox. Reference: EFForg/privacybadger#1954

@gbaptista gbaptista changed the title [WIP] Improve filterResponseData Improve filterResponseData Mar 22, 2019
@gbaptista gbaptista merged commit ae4311e into gb-advanced-options Mar 22, 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.

1 participant