mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1713619 - Exempt chrome/resource (incl PDF.js) principals from canvas randomization/placeholders. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D197149
This commit is contained in:
parent
5622e08a8c
commit
ff2bc9c19b
@ -54,6 +54,11 @@ static bool IsUnrestrictedPrincipal(nsIPrincipal& aPrincipal) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allow chrome: and resource: (this especially includes PDF.js)
|
||||
if (aPrincipal.SchemeIs("chrome") || aPrincipal.SchemeIs("resource")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allow extension principals.
|
||||
return aPrincipal.GetIsAddonOrExpandedAddonPrincipal();
|
||||
}
|
||||
@ -128,13 +133,6 @@ bool IsImageExtractionAllowed(dom::Document* aDocument, JSContext* aCx,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Don't show canvas prompt for PDF.js
|
||||
JS::AutoFilename scriptFile;
|
||||
if (JS::DescribeScriptedCaller(aCx, &scriptFile) && scriptFile.get() &&
|
||||
strcmp(scriptFile.get(), "resource://pdf.js/build/pdf.js") == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Possibly block third parties
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user