Explorar o código

always pass `cache`and `referrerPolicy` options to `fetch`

Gildas hai 1 ano
pai
achega
dddab9ed0f
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/lib/single-file/fetch/content/content-fetch.js

+ 5 - 1
src/lib/single-file/fetch/content/content-fetch.js

@@ -30,7 +30,11 @@ const FETCH_RESPONSE_EVENT = "single-file-response-fetch";
 const ERR_HOST_FETCH = "Host fetch error (SingleFile)";
 const USE_HOST_FETCH = Boolean(window.wrappedJSObject);
 
-const fetch = (url, options) => window.fetch(url, options);
+const fetch = (url, options) => {
+	options.cache = "force-cache";
+	options.referrerPolicy = "strict-origin-when-cross-origin";
+	window.fetch(url, options);
+};
 
 let requestId = 0, pendingResponses = new Map(), hostFetchSupported;