зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1262963 - Add env var for bypassing origin check of cssom. r=heycam
MozReview-Commit-ID: 2iMx3sz1QKS --HG-- extra : rebase_source : 747934a807246b7a61b78275fdabe3cf4df46c40
This commit is contained in:
Родитель
26469737d1
Коммит
9640535b81
|
@ -301,6 +301,9 @@ bool nsContentUtils::sGetBoxQuadsEnabled = false;
|
|||
bool nsContentUtils::sSkipCursorMoveForSameValueSet = false;
|
||||
bool nsContentUtils::sRequestIdleCallbackEnabled = false;
|
||||
bool nsContentUtils::sLowerNetworkPriority = false;
|
||||
#ifndef RELEASE_OR_BETA
|
||||
bool nsContentUtils::sBypassCSSOMOriginCheck = false;
|
||||
#endif
|
||||
|
||||
int32_t nsContentUtils::sPrivacyMaxInnerWidth = 1000;
|
||||
int32_t nsContentUtils::sPrivacyMaxInnerHeight = 1000;
|
||||
|
@ -715,6 +718,10 @@ nsContentUtils::Init()
|
|||
Preferences::AddBoolVarCache(&sRequestIdleCallbackEnabled,
|
||||
"dom.requestIdleCallback.enabled", false);
|
||||
|
||||
#ifndef RELEASE_OR_BETA
|
||||
sBypassCSSOMOriginCheck = getenv("MOZ_BYPASS_CSSOM_ORIGIN_CHECK");
|
||||
#endif
|
||||
|
||||
Preferences::AddBoolVarCache(&sLowerNetworkPriority,
|
||||
"privacy.trackingprotection.lower_network_priority", false);
|
||||
|
||||
|
|
|
@ -2231,6 +2231,21 @@ public:
|
|||
return sRequestIdleCallbackEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if CSSOM origin check should be skipped for WebDriver
|
||||
* based crawl to be able to collect data from cross-origin CSS style
|
||||
* sheets. This can be enabled by setting environment variable
|
||||
* MOZ_BYPASS_CSSOM_ORIGIN_CHECK.
|
||||
*/
|
||||
static bool BypassCSSOMOriginCheck()
|
||||
{
|
||||
#ifdef RELEASE_OR_BETA
|
||||
return false;
|
||||
#else
|
||||
return sBypassCSSOMOriginCheck;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this doc is controlled by a ServiceWorker.
|
||||
*/
|
||||
|
@ -3097,6 +3112,9 @@ private:
|
|||
static bool sSkipCursorMoveForSameValueSet;
|
||||
static bool sRequestIdleCallbackEnabled;
|
||||
static bool sLowerNetworkPriority;
|
||||
#ifndef RELEASE_OR_BETA
|
||||
static bool sBypassCSSOMOriginCheck;
|
||||
#endif
|
||||
static uint32_t sCookiesLifetimePolicy;
|
||||
static uint32_t sCookiesBehavior;
|
||||
|
||||
|
|
|
@ -609,8 +609,10 @@ StyleSheet::SubjectSubsumesInnerPrincipal(nsIPrincipal& aSubjectPrincipal,
|
|||
return;
|
||||
}
|
||||
|
||||
// Allow access only if CORS mode is not NONE
|
||||
if (GetCORSMode() == CORS_NONE) {
|
||||
// Allow access only if CORS mode is not NONE and the security flag
|
||||
// is not turned off.
|
||||
if (GetCORSMode() == CORS_NONE &&
|
||||
!nsContentUtils::BypassCSSOMOriginCheck()) {
|
||||
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче