From 21163be169793fca4fbbaffe1ba595303a722aba Mon Sep 17 00:00:00 2001 From: Ulrik de Muelenaere Date: Mon, 4 Sep 2023 23:29:18 -0400 Subject: [PATCH] autoconfig: Fix error due to Services import in FF 117 (MR 36) Since Firefox 104 the Services global is available automatically and no longer needs to be imported, and since Firefox 117 importing it is an error. --- src/mobile-config-autoconfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mobile-config-autoconfig.js b/src/mobile-config-autoconfig.js index 9abca3d..97adaab 100644 --- a/src/mobile-config-autoconfig.js +++ b/src/mobile-config-autoconfig.js @@ -18,7 +18,7 @@ // https://web.archive.org/web/20201018211550/https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Code_snippets/File_I_O const {classes: Cc, interfaces: Ci, utils: Cu} = Components; -Cu.import("resource://gre/modules/Services.jsm"); +const Services = globalThis.Services || Cu.import("resource://gre/modules/Services.jsm").Services; // for compatibility with FF < 104 Cu.import("resource://gre/modules/FileUtils.jsm"); var g_ff_version;