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

Check if we can load a surrogate even if the integrity mismatches. #43

Merged
merged 2 commits into from
Jul 16, 2021

Conversation

jonathanKingston
Copy link
Collaborator

@jonathanKingston jonathanKingston commented Jul 15, 2021

@kdzwinel / @jdorweiler this currently fails should I set shouldFail to true?

The idea here is we would like the browser to permit us loading a surrogate when the SRI check doesn't match. This would allow us to have surrogates for the likes of fingerprint.js and f***Adblock etc.

My hope is we can direct Chrome/Firefox etc at this page when we raise issues.

integrity: 'sha512-1xNTXD/ZeaKg/Xjb6De9la7CXo5gC1lMk+beyKo691KJrjlj0HbZG6frzK0Wo6bm96i9Cp6w/WB4vSN/8zDBLQ==',
notes: 'Fails loading in all browsers despite we think it should be possible for the extension to load this.',
shouldFail: false,
test: () => { return !!(window.ga && Object.keys(window.ga.create()).length === 0); },
Copy link
Member

Choose a reason for hiding this comment

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

This will be green if surrogate successfully loads, right? It will still be red if extension is disabled and original loads?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, although the integrity isn't valid also so shouldn't pass either.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

AKA this should only pass if the extension redirecting to a local extension resource is carved out within the browser code

Co-authored-by: Konrad Dzwinel <konrad@duckduckgo.com>
@kdzwinel
Copy link
Member

LGTM! Thanks 👏

@kdzwinel kdzwinel merged commit c5aa06a into gh-pages Jul 16, 2021
@kdzwinel kdzwinel deleted the integrity-surrogate branch July 16, 2021 13:30
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