зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1646960 - imported patch ignore-blocked-preloads.diff r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D80856
This commit is contained in:
Родитель
e3dbdcd341
Коммит
6799964058
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
add_task(async function() {
|
||||
const { tab, monitor } = await initNetMonitor(CSP_URL, { requestCount: 3 });
|
||||
const { tab, monitor } = await initNetMonitor(CSP_URL, { requestCount: 2 });
|
||||
|
||||
const { document, store, windowRequire } = monitor.panelWin;
|
||||
const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
|
||||
|
@ -18,11 +18,10 @@ add_task(async function() {
|
|||
|
||||
store.dispatch(Actions.batchEnable(false));
|
||||
|
||||
const wait = waitForNetworkEvents(monitor, 3);
|
||||
const wait = waitForNetworkEvents(monitor, 2);
|
||||
tab.linkedBrowser.reload();
|
||||
await wait;
|
||||
|
||||
info("Waiting until the requests appear in netmonitor");
|
||||
await wait;
|
||||
|
||||
// Ensure the attempt to load a JS file shows a blocked CSP error
|
||||
verifyRequestItemTarget(
|
||||
|
@ -32,7 +31,7 @@ add_task(async function() {
|
|||
"GET",
|
||||
EXAMPLE_URL + "js_websocket-worker-test.js",
|
||||
{
|
||||
transferred: "CSP Preload",
|
||||
transferred: "CSP",
|
||||
cause: { type: "script" },
|
||||
type: "",
|
||||
}
|
||||
|
|
|
@ -326,6 +326,20 @@ NetworkObserver.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
// Ignore preload requests to avoid duplicity request entries in
|
||||
// the Network panel. If a preload fails (for whatever reason)
|
||||
// then the platform kicks off another 'real' request.
|
||||
const type = channel.loadInfo.internalContentPolicyType;
|
||||
if (
|
||||
type == Ci.nsIContentPolicy.TYPE_INTERNAL_SCRIPT_PRELOAD ||
|
||||
type == Ci.nsIContentPolicy.TYPE_INTERNAL_MODULE_PRELOAD ||
|
||||
type == Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_PRELOAD ||
|
||||
type == Ci.nsIContentPolicy.TYPE_INTERNAL_STYLESHEET_PRELOAD ||
|
||||
type == Ci.nsIContentPolicy.TYPE_INTERNAL_FONT_PRELOAD
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const blockedCode = channel.loadInfo.requestBlockingReason;
|
||||
this._httpResponseExaminer(subject, topic, blockedCode);
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче