]> GeneralSync Git - oss/thunderbird-experiments.git/commitdiff
authorDirk Steinmetz <ds@generalsync.com>
Thu, 25 Jul 2024 19:19:31 +0000 (21:19 +0200)
committerDirk Steinmetz <ds@generalsync.com>
Thu, 25 Jul 2024 19:19:31 +0000 (21:19 +0200)
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/

experiments/cachingfix/README.md [deleted file]
experiments/cachingfix/api.json [deleted file]
experiments/cachingfix/manifest-snippet.json [deleted file]
experiments/cachingfix/parent.js [deleted file]

diff --git a/experiments/cachingfix/README.md b/experiments/cachingfix/README.md
deleted file mode 100644 (file)
index f0f0d43..0000000
+++ /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 (file)
index 9b6f3aa..0000000
+++ /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 (file)
index 8605889..0000000
+++ /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 (file)
index 454edc5..0000000
+++ /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: {}};
-  }
-};