mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1251875 - Part 1: Remove the dom.serviceWorkers.interception.enabled pref; r=bkelly
This commit is contained in:
parent
17f7689c91
commit
a67a5febad
@ -650,7 +650,6 @@ var settingsToObserve = {
|
||||
'dom.mozApps.signed_apps_installable_from': 'https://marketplace.firefox.com',
|
||||
'dom.presentation.discovery.enabled': false,
|
||||
'dom.presentation.discoverable': false,
|
||||
'dom.serviceWorkers.interception.enabled': true,
|
||||
'dom.serviceWorkers.testing.enabled': false,
|
||||
'gfx.layerscope.enabled': false,
|
||||
'layers.draw-borders': false,
|
||||
|
@ -210,7 +210,6 @@ function setup() {
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.interception.enabled", true]
|
||||
]}, () => {
|
||||
SpecialPowers.pushPermissions([
|
||||
{ "type": "webapps-manage", "allow": 1, "context": document },
|
||||
|
@ -1646,7 +1646,6 @@ pref("reader.errors.includeURLs", true);
|
||||
pref("view_source.tab", true);
|
||||
|
||||
pref("dom.serviceWorkers.enabled", true);
|
||||
pref("dom.serviceWorkers.interception.enabled", true);
|
||||
pref("dom.serviceWorkers.openWindow.enabled", true);
|
||||
pref("dom.webnotifications.serviceworker.enabled", true);
|
||||
|
||||
|
@ -14157,11 +14157,6 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
|
||||
bool* aShouldIntercept)
|
||||
{
|
||||
*aShouldIntercept = false;
|
||||
// Preffed off.
|
||||
if (!nsContentUtils::ServiceWorkerInterceptionEnabled()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// No in private browsing
|
||||
if (mInPrivateBrowsing) {
|
||||
return NS_OK;
|
||||
|
@ -274,7 +274,6 @@ bool nsContentUtils::sEncodeDecodeURLHash = false;
|
||||
bool nsContentUtils::sGettersDecodeURLHash = false;
|
||||
bool nsContentUtils::sPrivacyResistFingerprinting = false;
|
||||
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
|
||||
bool nsContentUtils::sSWInterceptionEnabled = false;
|
||||
|
||||
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
|
||||
|
||||
@ -569,10 +568,6 @@ nsContentUtils::Init()
|
||||
Preferences::AddBoolVarCache(&sPrivacyResistFingerprinting,
|
||||
"privacy.resistFingerprinting", false);
|
||||
|
||||
Preferences::AddBoolVarCache(&sSWInterceptionEnabled,
|
||||
"dom.serviceWorkers.interception.enabled",
|
||||
false);
|
||||
|
||||
Preferences::AddUintVarCache(&sHandlingInputTimeout,
|
||||
"dom.event.handling-user-input-time-limit",
|
||||
1000);
|
||||
@ -1754,8 +1749,7 @@ nsContentUtils::ParseLegacyFontSize(const nsAString& aValue)
|
||||
bool
|
||||
nsContentUtils::IsControlledByServiceWorker(nsIDocument* aDocument)
|
||||
{
|
||||
if (!ServiceWorkerInterceptionEnabled() ||
|
||||
nsContentUtils::IsInPrivateBrowsing(aDocument)) {
|
||||
if (nsContentUtils::IsInPrivateBrowsing(aDocument)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1996,14 +1996,6 @@ public:
|
||||
return sSendPerformanceTimingNotifications;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if ServiceWorker Interception is enabled by pref.
|
||||
*/
|
||||
static bool ServiceWorkerInterceptionEnabled()
|
||||
{
|
||||
return sSWInterceptionEnabled;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if the frame timing APIs are enabled.
|
||||
*/
|
||||
@ -2706,7 +2698,6 @@ private:
|
||||
static bool sGettersDecodeURLHash;
|
||||
static bool sPrivacyResistFingerprinting;
|
||||
static bool sSendPerformanceTimingNotifications;
|
||||
static bool sSWInterceptionEnabled;
|
||||
static uint32_t sCookiesLifetimePolicy;
|
||||
static uint32_t sCookiesBehavior;
|
||||
|
||||
|
@ -43,7 +43,6 @@ SpecialPowers.pushPrefEnv({'set': [
|
||||
['gfx.offscreencanvas.enabled', true],
|
||||
['webgl.force-enabled', true],
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -326,7 +326,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.interception.enabled", true]
|
||||
]}, runTest);
|
||||
SpecialPowers.addPermission('desktop-notification', true, document);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -135,7 +135,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.enabled", true]
|
||||
|
@ -36,7 +36,6 @@ function receiveMessage(event) {
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.enabled", true]
|
||||
|
@ -22,7 +22,6 @@ interface ServiceWorkerGlobalScope : WorkerGlobalScope {
|
||||
attribute EventHandler oninstall;
|
||||
attribute EventHandler onactivate;
|
||||
|
||||
[Func="mozilla::dom::workers::ServiceWorkerGlobalScope::InterceptionEnabled"]
|
||||
attribute EventHandler onfetch;
|
||||
|
||||
// The event.source of these MessageEvents are instances of Client
|
||||
|
@ -31,7 +31,6 @@ WORKER_SIMPLE_PREF("dom.webnotifications.enabled", DOMWorkerNotificationEnabled,
|
||||
WORKER_SIMPLE_PREF("dom.webnotifications.serviceworker.enabled", DOMServiceWorkerNotificationEnabled, DOM_SERVICEWORKERNOTIFICATION)
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.enabled", ServiceWorkersEnabled, SERVICEWORKERS_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.testing.enabled", ServiceWorkersTestingEnabled, SERVICEWORKERS_TESTING_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.interception.enabled", InterceptionEnabled, INTERCEPTION_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.interception.opaque.enabled", OpaqueInterceptionEnabled, INTERCEPTION_OPAQUE_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.openWindow.enabled", OpenWindowEnabled, OPEN_WINDOW_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.push.enabled", PushEnabled, PUSH_ENABLED)
|
||||
|
@ -633,16 +633,6 @@ ServiceWorkerGlobalScope::SkipWaiting(ErrorResult& aRv)
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
ServiceWorkerGlobalScope::InterceptionEnabled(JSContext* aCx, JSObject* aObj)
|
||||
{
|
||||
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
|
||||
MOZ_ASSERT(worker);
|
||||
worker->AssertIsOnWorkerThread();
|
||||
return worker->InterceptionEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
ServiceWorkerGlobalScope::OpenWindowEnabled(JSContext* aCx, JSObject* aObj)
|
||||
{
|
||||
|
@ -239,9 +239,6 @@ public:
|
||||
WrapGlobalObject(JSContext* aCx,
|
||||
JS::MutableHandle<JSObject*> aReflector) override;
|
||||
|
||||
static bool
|
||||
InterceptionEnabled(JSContext* aCx, JSObject* aObj);
|
||||
|
||||
static bool
|
||||
OpenWindowEnabled(JSContext* aCx, JSObject* aObj);
|
||||
|
||||
|
@ -45,8 +45,7 @@ function test() {
|
||||
|
||||
SpecialPowers.pushPrefEnv({'set': [['dom.serviceWorkers.enabled', true],
|
||||
['dom.serviceWorkers.exemptFromPerDomainMax', true],
|
||||
['dom.serviceWorkers.testing.enabled', true],
|
||||
['dom.serviceWorkers.interception.enabled', true]]},
|
||||
['dom.serviceWorkers.testing.enabled', true]]},
|
||||
function() {
|
||||
var url = gTestRoot + 'download/window.html';
|
||||
var tab = gBrowser.addTab();
|
||||
|
@ -29,7 +29,6 @@ function test() {
|
||||
SpecialPowers.pushPrefEnv({'set': [['dom.serviceWorkers.enabled', true],
|
||||
['dom.serviceWorkers.exemptFromPerDomainMax', true],
|
||||
['dom.serviceWorkers.testing.enabled', true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
['dom.caches.enabled', true],
|
||||
['browser.cache.disk.enable', false],
|
||||
['browser.cache.memory.enable', false]]},
|
||||
|
@ -1,4 +0,0 @@
|
||||
// Only succeeds if onfetch is available.
|
||||
if (!("onfetch" in self)) {
|
||||
throw new Error("Not capable of interception");
|
||||
}
|
@ -171,7 +171,6 @@ support-files =
|
||||
strict_mode_warning.js
|
||||
skip_waiting_installed_worker.js
|
||||
skip_waiting_scope/index.html
|
||||
interception_featuredetect.js
|
||||
thirdparty/iframe1.html
|
||||
thirdparty/iframe2.html
|
||||
thirdparty/register.html
|
||||
@ -239,8 +238,6 @@ skip-if = e10s && debug && os == 'win'
|
||||
skip-if = e10s && debug && os == 'win'
|
||||
[test_installation_simple.html]
|
||||
skip-if = e10s && debug && os == 'win'
|
||||
[test_interception_featuredetect.html]
|
||||
skip-if = e10s && debug && os == 'win'
|
||||
[test_match_all.html]
|
||||
skip-if = e10s && debug && os == 'win'
|
||||
[test_match_all_advanced.html]
|
||||
|
@ -94,7 +94,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.enabled", true],
|
||||
|
@ -162,7 +162,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -88,7 +88,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -68,7 +68,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -86,7 +86,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -54,7 +54,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -74,7 +74,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -40,7 +40,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -44,7 +44,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
// This is needed so that we can test upgrading a non-secure load inside an https iframe.
|
||||
["security.mixed_content.block_active_content", false],
|
||||
["security.mixed_content.block_display_content", false],
|
||||
|
@ -36,7 +36,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -44,7 +44,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
]}, runTest);
|
||||
</script>
|
||||
</pre>
|
||||
|
@ -95,7 +95,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.interception.opaque.enabled", true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -73,7 +73,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.interception.opaque.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
|
@ -135,7 +135,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -74,7 +74,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.enabled", true],
|
||||
|
@ -77,7 +77,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
]}, runTest);
|
||||
</script>
|
||||
</pre>
|
||||
|
@ -54,7 +54,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
// This is needed so that we can test upgrading a non-secure load inside an https iframe.
|
||||
["security.mixed_content.block_active_content", false],
|
||||
["security.mixed_content.block_display_content", false],
|
||||
|
@ -51,7 +51,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.enabled", true]
|
||||
|
@ -45,7 +45,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.enabled", true]
|
||||
|
@ -48,7 +48,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
};
|
||||
|
@ -48,7 +48,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
};
|
||||
|
@ -58,7 +58,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.enabled", true]
|
||||
|
@ -45,7 +45,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -63,7 +63,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
]}, runTest);
|
||||
};
|
||||
</script>
|
||||
|
@ -63,7 +63,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -42,7 +42,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["security.mixed_content.block_active_content", false],
|
||||
|
@ -134,7 +134,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -201,7 +201,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.caches.testing.enabled", true],
|
||||
|
@ -1,96 +0,0 @@
|
||||
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 1173389 - Test fetch interception feature detection.</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
function register() {
|
||||
// Randomness required to prevent reusing existing registration.
|
||||
return navigator.serviceWorker.register("interception_featuredetect.js",
|
||||
{ scope: "featuredetect/" + Math.random() });
|
||||
}
|
||||
|
||||
function registerWithPrefDisabled() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{"set": [["dom.serviceWorkers.interception.enabled", false]]},
|
||||
function() {
|
||||
register().then(function(v) {
|
||||
ok(false, "Registration should fail when interception is disabled.");
|
||||
reject();
|
||||
}, function(e) {
|
||||
ok(true, "Registration should fail when interception is disabled.");
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function registerWithPrefEnabled() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{"set": [["dom.serviceWorkers.interception.enabled", true]]},
|
||||
function() {
|
||||
register().then(function(v) {
|
||||
ok(true, "Registration should succeed when interception is enabled.");
|
||||
resolve();
|
||||
}, function(e) {
|
||||
ok(false, "Registration should succeed when interception is enabled.");
|
||||
reject()
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function unregister() {
|
||||
return navigator.serviceWorker.getRegistrations().then(function(regs) {
|
||||
var unregs = [];
|
||||
regs.forEach(function(reg) {
|
||||
if (reg.scope.indexOf("featuredetect") > -1) {
|
||||
unregs.push(reg.unregister());
|
||||
}
|
||||
})
|
||||
|
||||
return Promise.all(unregs);
|
||||
});
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
Promise.resolve()
|
||||
.then(registerWithPrefDisabled)
|
||||
.then(registerWithPrefEnabled)
|
||||
.then(registerWithPrefDisabled)
|
||||
.then(unregister)
|
||||
// put more tests here.
|
||||
.then(function() {
|
||||
SimpleTest.finish();
|
||||
}).catch(function(e) {
|
||||
ok(false, "Some test failed with error " + e);
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", false],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -70,7 +70,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -90,7 +90,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -81,7 +81,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -88,7 +88,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true]
|
||||
]}, function() {
|
||||
checkEnabled();
|
||||
|
@ -68,7 +68,6 @@
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.requestcontext.enabled", true],
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.interception.opaque.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
|
@ -55,7 +55,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=916893
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.webnotifications.workers.enabled", true],
|
||||
["dom.webnotifications.serviceworker.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
["notification.prompt.testing", true],
|
||||
]}, runTest);
|
||||
</script>
|
||||
|
@ -77,7 +77,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
["dom.serviceWorkers.interception.opaque.enabled", true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -48,7 +48,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
};
|
||||
|
@ -48,7 +48,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
};
|
||||
|
@ -48,7 +48,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
};
|
||||
|
@ -48,7 +48,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
["dom.caches.enabled", true],
|
||||
]}, runTest);
|
||||
};
|
||||
|
@ -69,7 +69,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -98,7 +98,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -57,7 +57,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -70,7 +70,6 @@ onload = function() {
|
||||
["dom.image.srcset.enabled", true],
|
||||
["dom.requestcontext.enabled", true],
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -40,7 +40,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -75,7 +75,6 @@
|
||||
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, function() {
|
||||
|
@ -78,7 +78,6 @@
|
||||
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, function() {
|
||||
|
@ -111,7 +111,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -67,7 +67,6 @@
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
]}, runTest);
|
||||
</script>
|
||||
</pre>
|
||||
|
@ -104,7 +104,6 @@
|
||||
// force creation of our own Navigator object before our prefs are set.
|
||||
var prefs = [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
];
|
||||
|
@ -56,7 +56,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -86,7 +86,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -32,7 +32,6 @@
|
||||
onload = function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -144,7 +144,6 @@ let steps = [() => {
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["browser.dom.window.dump.enabled", true],
|
||||
["network.cookie.cookieBehavior", COOKIE_BEHAVIOR_ACCEPT]
|
||||
]}, next);
|
||||
|
@ -128,7 +128,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -87,7 +87,6 @@
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.interception.enabled", true]
|
||||
]}, runTest);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
|
@ -72,7 +72,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -52,7 +52,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, runTest);
|
||||
|
@ -75,7 +75,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -118,7 +118,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
]}, runTest);
|
||||
|
@ -980,7 +980,6 @@ pref("dom.vr.enabled", true);
|
||||
pref("browser.tabs.showAudioPlayingIcon", true);
|
||||
|
||||
pref("dom.serviceWorkers.enabled", true);
|
||||
pref("dom.serviceWorkers.interception.enabled", true);
|
||||
|
||||
// The remote content URL where FxAccountsWebChannel messages originate. Must use HTTPS.
|
||||
pref("identity.fxaccounts.remote.webchannel.uri", "https://accounts.firefox.com");
|
||||
|
@ -143,9 +143,6 @@ pref("dom.workers.maxPerDomain", 50);
|
||||
|
||||
pref("dom.serviceWorkers.enabled", false);
|
||||
|
||||
// Allow service workers to intercept network requests using the fetch event
|
||||
pref("dom.serviceWorkers.interception.enabled", false);
|
||||
|
||||
// Allow service workers to intercept opaque (cross origin) responses
|
||||
pref("dom.serviceWorkers.interception.opaque.enabled", true);
|
||||
|
||||
|
@ -7218,14 +7218,11 @@ nsHttpChannel::MaybeWarnAboutAppCache()
|
||||
Telemetry::Accumulate(Telemetry::HTTP_OFFLINE_CACHE_DOCUMENT_LOAD,
|
||||
true);
|
||||
|
||||
// Then, issue a deprecation warning if service worker interception is
|
||||
// enabled.
|
||||
if (nsContentUtils::ServiceWorkerInterceptionEnabled()) {
|
||||
nsCOMPtr<nsIDeprecationWarner> warner;
|
||||
GetCallback(warner);
|
||||
if (warner) {
|
||||
warner->IssueWarning(nsIDocument::eAppCache, false);
|
||||
}
|
||||
// Then, issue a deprecation warning.
|
||||
nsCOMPtr<nsIDeprecationWarner> warner;
|
||||
GetCallback(warner);
|
||||
if (warner) {
|
||||
warner->IssueWarning(nsIDocument::eAppCache, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.expectRegisteredServiceWorker();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, function() {
|
||||
|
@ -9,7 +9,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true]
|
||||
]}, function() {
|
||||
|
@ -166,7 +166,6 @@ comma-seperate list of `pref.name:value` items to set e.g.
|
||||
|
||||
[filename.html]
|
||||
prefs: [dom.serviceWorkers.enabled:true,
|
||||
dom.serviceWorkers.interception.enabled:true,
|
||||
dom.serviceWorkers.exemptFromPerDomainMax:true,
|
||||
dom.caches.enabled:true]
|
||||
|
||||
|
@ -1 +1 @@
|
||||
prefs: [dom.serviceWorkers.enabled: true, dom.serviceWorkers.interception.enabled: true, dom.serviceWorkers.exemptFromPerDomainMax:true, dom.caches.enabled:true]
|
||||
prefs: [dom.serviceWorkers.enabled: true, dom.serviceWorkers.exemptFromPerDomainMax:true, dom.caches.enabled:true]
|
||||
|
@ -1,3 +1,2 @@
|
||||
prefs: [dom.serviceWorkers.enabled: true,
|
||||
dom.serviceWorkers.interception.enabled: true,
|
||||
dom.serviceWorkers.interception.opaque.enabled: true]
|
||||
|
@ -1,3 +1,2 @@
|
||||
prefs: [dom.serviceWorkers.enabled: true,
|
||||
dom.serviceWorkers.interception.enabled: true,
|
||||
dom.serviceWorkers.interception.opaque.enabled: true]
|
||||
|
Loading…
Reference in New Issue
Block a user