Bug 1813489: Remove pref dom.security.secFetch.enabled, r=dveditz

Differential Revision: https://phabricator.services.mozilla.com/D168229
This commit is contained in:
Christoph Kerschbaumer 2023-01-31 15:47:07 +00:00
parent c9c81d4680
commit 0866d5a7c5
10 changed files with 18 additions and 55 deletions

View File

@ -379,11 +379,6 @@ void mozilla::dom::SecFetch::AddSecFetchUser(nsIHttpChannel* aHTTPChannel) {
}
void mozilla::dom::SecFetch::AddSecFetchHeader(nsIHttpChannel* aHTTPChannel) {
// if sec-fetch-* is prefed off, then there is nothing to do
if (!StaticPrefs::dom_security_secFetch_enabled()) {
return;
}
nsCOMPtr<nsIURI> uri;
nsresult rv = aHTTPChannel->GetURI(getter_AddRefs(uri));
if (NS_WARN_IF(NS_FAILED(rv))) {

View File

@ -8,10 +8,6 @@ let gExpectedHeader = {};
async function setup() {
waitForExplicitFinish();
await SpecialPowers.pushPrefEnv({
set: [["dom.security.secFetch.enabled", true]],
});
}
function checkSecFetchUser(subject, topic, data) {
@ -166,10 +162,6 @@ async function testNavigations() {
add_task(async function() {
waitForExplicitFinish();
await SpecialPowers.pushPrefEnv({
set: [["dom.security.secFetch.enabled", true]],
});
await testNavigations();
// If fission is enabled we also want to test the navigations with the bfcache

View File

@ -76,12 +76,9 @@ function iframeAction(test) {
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({set: [["dom.security.secFetch.enabled", true]]}, async () => {
testFrame = document.createElement('iframe');
testFrame.src = `https://example.org/${REQUEST_PATH}?test`;
document.body.appendChild(testFrame);
});
testFrame = document.createElement('iframe');
testFrame.src = `https://example.org/${REQUEST_PATH}?test`;
document.body.appendChild(testFrame);
</script>
</body>

View File

@ -86,11 +86,9 @@ script.addMessageListener("test-pass", async () => {
SimpleTest.finish();
});
SpecialPowers.pushPrefEnv({set: [["dom.security.secFetch.enabled", true]]}, async () => {
let frame = document.createElement("iframe");
frame.src = REQUEST_URL + "?meta";
document.body.appendChild(frame);
});
let frame = document.createElement("iframe");
frame.src = REQUEST_URL + "?meta";
document.body.appendChild(frame);
</script>
</body>

View File

@ -86,11 +86,9 @@ script.addMessageListener("test-pass", async () => {
SimpleTest.finish();
});
SpecialPowers.pushPrefEnv({set: [["dom.security.secFetch.enabled", true]]}, async () => {
let frame = document.createElement("iframe");
frame.srcdoc = `<meta http-equiv="refresh" content="0; url='${REQUEST_URL}?meta'">`;
document.body.appendChild(frame);
});
let frame = document.createElement("iframe");
frame.srcdoc = `<meta http-equiv="refresh" content="0; url='${REQUEST_URL}?meta'">`;
document.body.appendChild(frame);
</script>
</body>

View File

@ -91,9 +91,7 @@ script.addMessageListener("test-pass", async () => {
SimpleTest.finish();
});
SpecialPowers.pushPrefEnv({set: [["dom.security.secFetch.enabled", true]]}, async () => {
testWindow = window.open(REQUEST_URL + "?meta");
});
testWindow = window.open(REQUEST_URL + "?meta");
</script>
</body>

View File

@ -60,20 +60,14 @@ script.addMessageListener("test-end", () => {
checkTestsDone();
});
function test_sec_fetch_websocket() {
var wssSocket = new WebSocket("wss://example.com/tests/dom/security/test/sec-fetch/file_websocket");
wssSocket.onopen = function(e) {
ok(true, "sanity: wssSocket onopen");
checkTestsDone();
};
wssSocket.onerror = function(e) {
ok(false, "sanity: wssSocket onerror");
};
}
SpecialPowers.pushPrefEnv({
set: [["dom.security.secFetch.enabled", true]]
}, test_sec_fetch_websocket);
var wssSocket = new WebSocket("wss://example.com/tests/dom/security/test/sec-fetch/file_websocket");
wssSocket.onopen = function(e) {
ok(true, "sanity: wssSocket onopen");
checkTestsDone();
};
wssSocket.onerror = function(e) {
ok(false, "sanity: wssSocket onerror");
};
</script>
</body>

View File

@ -3599,13 +3599,6 @@
value: false
mirror: always
# This pref enables Sec-Fetch-* logic and causes corresponding
# request headers to be set.
- name: dom.security.secFetch.enabled
type: RelaxedAtomicBool
value: true
mirror: always
# This pref enables the featurePolicy header support.
- name: dom.security.featurePolicy.header.enabled
type: bool

View File

@ -1,3 +1,2 @@
prefs: [dom.security.secFetch.enabled:true]
lsan-allowed: [Alloc, Create, MakeUnique, Malloc, PLDHashTable::ChangeTable, PLDHashTable::MakeEntryHandle, Realloc, allocate, createTable, mozilla::BasePrincipal::CreateContentPrincipal, mozilla::Permission::Create, mozilla::ThrottledEventQueue::Create, mozilla::WeakPtr, mozilla::dom::BrowsingContext::Attach, mozilla::dom::BrowsingContext::CreateChildSHistory, mozilla::dom::BrowsingContext::CreateDetached, mozilla::dom::CanonicalBrowsingContext::GetSecureBrowserUI, mozilla::dom::ContentParent::CreateBrowser, mozilla::dom::Performance::CreateForMainThread, mozilla::dom::PerformanceMainThread::CreateNavigationTimingEntry, mozilla::dom::ReferrerInfo::Clone, mozilla::dom::ServiceWorker::Create, mozilla::extensions::ChannelWrapper::ChannelWrapper, mozilla::net::HttpBaseChannel::CloneLoadInfoForRedirect, mozilla::net::HttpBaseChannel::HttpBaseChannel, mozilla::net::nsStandardURL::TemplatedMutator, nsDynamicAtom::Create, nsHashPropertyBagBase::SetPropertyAsInterface, operator]
leak-threshold: [default:51200, tab:358400]

View File

@ -1,3 +1,2 @@
prefs: [dom.security.secFetch.enabled:true]
lsan-disabled: true
leak-threshold: [tab:51200]