Limit the WebKit response handoff to uncontrolled visits

This commit is contained in:
Jonathan Sykes
2026-10-08 10:08:35 +08:00
parent 97eb31e732
commit 9408ee07e5
4 changed files with 23 additions and 10 deletions

View File

@@ -125,7 +125,7 @@
// Own this response once. Classic-script and fetch preloads do not share
// their cached bodies in WebKit; the later bootstrap consumes this promise.
const agent=root.navigator.userAgent || '';
api.captureApp=!!(manifest.appCache && root.crypto?.subtle && /AppleWebKit\//.test(agent) && !/(?:Chrome|Chromium|Edg|OPR)\//.test(agent));
api.captureApp=!!(manifest.appCache && !root.navigator.serviceWorker?.controller && root.crypto?.subtle && /AppleWebKit\//.test(agent) && !/(?:Chrome|Chromium|Edg|OPR)\//.test(agent));
if(api.captureApp) {
api.appResponse=(async()=>{
const key=url('/app.js');