andy-portmen / country-flags

adds a toolbar button to browser address-bar displaying current physical location of visited website
https://webextension.org/listing/country-flags.html
Mozilla Public License 2.0
138 stars 35 forks source link

ReferenceError: "caches is not defined worker.js" #72

Closed ExceptionGit closed 4 years ago

ExceptionGit commented 4 years ago

Work for local ip/domain, but for other ReferenceError: caches is not defined worker.js:42:1 https://github.com/andy-portmen/country-flags/blob/a935487f3d96730bf3f39b1b4e51d7b44a03ae7a/country-flags/firefox/worker.js#L42-L49

user.js(firefox), may help https://github.com/ghacksuserjs/ghacks-user.js/issues/70 :

user_pref("dom.serviceWorkers.enabled", false);
user_pref("dom.webnotifications.enabled", false);
user_pref("dom.webnotifications.serviceworker.enabled", false);
user_pref("dom.push.enabled", false);
user_pref("browser.cache.offline.enable", false);
user_pref("dom.caches.enabled", false); //when this set true 'work'

How about disable cache and use offline mode if get error? Or add checkbox for disable cache(cdn update). https://github.com/andy-portmen/country-flags/blob/a935487f3d96730bf3f39b1b4e51d7b44a03ae7a/country-flags/firefox/worker.js#L49-L52

andy-portmen commented 4 years ago

Thanks for the report. Should use the offline db when server is not accessible.