Skip to content

Commit

Permalink
Check if we can load a surrogate even if the integrity mismatches.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanKingston committed Jul 15, 2021
1 parent 0600fb3 commit 3566677
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions privacy-protections/surrogates/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ const surrogates = {
test: () => { return !!(window.ga && Object.keys(window.ga.create()).length === 0); },
cleanUp: () => { delete window.ga; }
},
'google-analytics.com/analytics.js broken integrity': {
url: 'https://google-analytics.com/analytics.js',
crossOrigin: 'anonymous',
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); },
cleanUp: () => { delete window.ga; }
},
'google-analytics.com/analytics.js': {
url: 'https://google-analytics.com/analytics.js',
shouldFail: false,
Expand All @@ -77,6 +86,9 @@ const surrogates = {
if (testData.crossOrigin) {
s.crossOrigin = testData.crossOrigin;
}
if (testData.integrity) {
s.integrity = testData.integrity;
}

s.onload = () => {
updateTable({ name, testData });
Expand Down

0 comments on commit 3566677

Please sign in to comment.