Browse Source

fix: tracking of file:// source in FF68+

regressed in f1e0ba56
tophf 4 years ago
parent
commit
d477a5c11d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/confirm/views/app.vue

+ 3 - 1
src/confirm/views/app.vue

@@ -168,7 +168,9 @@ export default {
     }
     const { url } = this.info;
     this.decodedUrl = decodeURIComponent(url);
-    filePortNeeded = ua.isFirefox >= 68 && url.startsWith('file:');
+    /* sendCmdDirectly makes the page load so fast that ua.isFirefox is still a boolean,
+       so we'll detect FF68 that stopped allowing file: scheme in fetch() via a CSS feature */
+    filePortNeeded = url.startsWith('file:') && ua.isFirefox && CSS.supports('counter-set', 'none');
     this.guard = setInterval(sendCmdDirectly, KEEP_INFO_DELAY, 'CacheHit', { key });
     await this.loadData();
     await this.parseMeta();