Skip to content
Snippets Groups Projects
Commit 3d825612 authored by Tom Schuster's avatar Tom Schuster
Browse files

Bug 1713619 - ESR 115: Exempt chrome/resource principals from canvas...

Bug 1713619 - ESR 115: Exempt chrome/resource principals from canvas randomization/placeholders. r=lsalzman a=pascalc

Differential Revision: https://phabricator.services.mozilla.com/D197580
parent cd14fcba
No related branches found
No related tags found
No related merge requests found
......@@ -110,6 +110,11 @@ bool IsImageExtractionAllowed(dom::Document* aDocument, JSContext* aCx,
return true;
}
// Allow chrome: and resource: (this especially includes PDF.js)
if (subjectPrincipal.SchemeIs("chrome") || subjectPrincipal.SchemeIs("resource")) {
return true;
}
// Allow extension principals.
auto* principal = BasePrincipal::Cast(&subjectPrincipal);
if (principal->AddonPolicy() || principal->ContentScriptAddonPolicy()) {
......@@ -126,13 +131,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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment