Skip to content

Commit

Permalink
Use Services global variable if possible
Browse files Browse the repository at this point in the history
Services.jsm is planned to be removed in Firefox 117 cycle in https://bugzilla.mozilla.org/show_bug.cgi?id=1780695 .
Services global variable is available in WebExtensions experiments API global
from version 88 https://bugzilla.mozilla.org/show_bug.cgi?id=1698158 ,
and experiments code doesn't have to import Services.jsm for recent versions.
  • Loading branch information
arai-a committed Jun 30, 2023
1 parent ca0e0f6 commit fa37e56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions experiments/displayReceivedHeader.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* global ChromeUtils */
/* global ChromeUtils, globalThis */
/* exported displayReceivedHeader */

"use strict";

const {ExtensionCommon} = ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
const [majorVersion] = Services.appinfo.platformVersion.split(".", 1);

// eslint-disable-next-line no-var
Expand Down

0 comments on commit fa37e56

Please sign in to comment.