CSS resources prefetching as a mitigation against CSS PP0 (https://github.com/Yossioren/pp0).

This commit is contained in:
hackademix 2021-03-13 00:35:34 +01:00
parent 5cd6a01b5c
commit de80b7b115
3 changed files with 11 additions and 1 deletions

View File

@ -178,6 +178,15 @@ ns.on("capabilities", () => {
notifyPage(); notifyPage();
}); });
prefetchCSSResources(false, (rule, url) => {
debug("Prefetching %s from CSS", url, rule.cssText);
/* Uncomment to debug prefetching by prefixing the prefetched domains
url.hostname = `prefetch.${url.hostname}`;
new Image().src = url;
return true;
*/
});
ns.fetchPolicy(); ns.fetchPolicy();
notifyPage(); notifyPage();

View File

@ -103,6 +103,7 @@
"nscl/common/RequestKey.js", "nscl/common/RequestKey.js",
"content/DocumentCSP.js", "content/DocumentCSP.js",
"nscl/content/NoscriptElements.js", "nscl/content/NoscriptElements.js",
"/nscl/content/prefetchCSSResources.js",
"content/onScriptDisabled.js", "content/onScriptDisabled.js",
"content/staticNS.js", "content/staticNS.js",
"content/PlaceHolder.js", "content/PlaceHolder.js",

@ -1 +1 @@
Subproject commit b222a9fdb06ff5ae5049aeeee32dcc83a4ef4c2a Subproject commit 7ec0758e425af9676466fe5f537b65b7998d4823