FIX: Service worker for Safari (#21435)

The first rule in the service worker is bypassed for Safari, but the
previous detection method was matching any browser running on macOS.
This commit is contained in:
Bianca Nenciu 2023-05-09 17:36:20 +02:00 committed by GitHub
parent e8aea3c558
commit 9ae5ddb330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ var externalCacheName = "external-" + cacheVersion;
// https://bugs.chromium.org/p/chromium/issues/detail?id=1286367
var chromeVersionMatch = navigator.userAgent.match(/Chrome\/97.0.(\d+)/);
var isBrokenChrome97 = chromeVersionMatch && parseInt(chromeVersionMatch[1]) <= 4692;
var isApple = /iPhone|iPod|Mac OS/.test(navigator.userAgent);
var isApple = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
// Cache all GET requests, so Discourse can be used while offline
workbox.routing.registerRoute(