From: Dirk Steinmetz Date: Thu, 25 Jul 2024 19:19:31 +0000 (+0200) Subject: cachingfix: remove obsolete experiment X-Git-Url: https://git.generalsync.com/oss/thunderbird-experiments.git/commitdiff_plain cachingfix: remove obsolete experiment Recent versions of Thunderbird only permit to load modules from resource:// and chrome:// URIs, so the cachingfix experiment is no longer useful. If you relied on it, consider migrating to the ResourceUrl experiment aviailable in Thunderbird's add-on developer support repository at https://github.com/thundernest/addon-developer-support/ --- diff --git a/experiments/cachingfix/README.md b/experiments/cachingfix/README.md deleted file mode 100644 index f0f0d43..0000000 --- a/experiments/cachingfix/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# CachingFix - -This WebExtension Experiment helps with cache-related cleanup tasks when -disabling, uninstalling or updating the add-on. - -## Usage - -Copy the experiment into your add-on and add it to your manifest.json: -``` -{ - "experiment_apis": { - "ex_cachingfix": { - "schema": "experiments/cachingfix/api.json", - "parent": { - "scopes": ["addon_parent"], - "paths": [["ex_cachingfix"]], - "script": "experiments/cachingfix/parent.js", - "events": ["startup"] - } - } - } -} -``` - -After adding the experiment, you no longer need to unload JSMs loaded from -the WebExtension's rootURI (file://- or jar://-URLs) or invalidate the -startup cache by hand. You do not need to invoke the API in any way, the -experiment is activated automatically. diff --git a/experiments/cachingfix/api.json b/experiments/cachingfix/api.json deleted file mode 100644 index 9b6f3aa..0000000 --- a/experiments/cachingfix/api.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "namespace": "ex_cachingfix", - "description": "This experiment automatically unloads all other experiment's JSMs and clears caches to enable correct update behavior. It does not need to get called in any way, just including it is sufficient." - } -] diff --git a/experiments/cachingfix/manifest-snippet.json b/experiments/cachingfix/manifest-snippet.json deleted file mode 100644 index 8605889..0000000 --- a/experiments/cachingfix/manifest-snippet.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "experiment_apis": { - "ex_cachingfix": { - "schema": "experiments/cachingfix/api.json", - "parent": { - "scopes": ["addon_parent"], - "paths": [["ex_cachingfix"]], - "script": "experiments/cachingfix/parent.js", - "events": ["startup"] - } - } - } -} diff --git a/experiments/cachingfix/parent.js b/experiments/cachingfix/parent.js deleted file mode 100644 index 454edc5..0000000 --- a/experiments/cachingfix/parent.js +++ /dev/null @@ -1,26 +0,0 @@ -var ex_cachingfix = class extends ExtensionCommon.ExtensionAPI { - onStartup() { - // we're not actually interested in startup, we need the event only - // to ensure this experiment gets loaded. - } - onShutdown(isAppShutdown) { - if (isAppShutdown) { - return; // the application gets unloaded anyway - } - // Unload JSMs of this add-on - const Cu = Components.utils; - const rootURI = this.extension.rootURI.spec; - for (let module of Cu.loadedModules) { - if (module.startsWith(rootURI)) { - Cu.unload(module); - } - } - // Clear caches that could prevent upgrades from working properly - const Services = globalThis.Services || - ChromeUtils.import("resource://gre/modules/Services.jsm").Services; - Services.obs.notifyObservers(null, "startupcache-invalidate", null); - } - getAPI(context) { - return {ex_cachingfix: {}}; - } -};