зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
5622e08a8c
Коммит
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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче