-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to work with Firefox 67 (compatibility with https://bugzilla.m…
- Loading branch information
AlexVallat
committed
Mar 19, 2019
1 parent
e5ac5a1
commit 298e3ab
Showing
3 changed files
with
30 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ const { utils: Cu , classes: Cc, interfaces: Ci} = Components; | |
|
||
const globalMessageManager = Cc["@mozilla.org/globalmessagemanager;1"].getService(); | ||
|
||
ChromeUtils.import("resource://gre/modules/Services.jsm"); | ||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); | ||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); | ||
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); | ||
|
||
//ChromeUtils.import("resource://gre/modules/Timer.jsm"); | ||
|
||
|
@@ -231,13 +231,20 @@ this.legacy = class extends ExtensionAPI { | |
// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1460555 | ||
async workaround1406055() { | ||
if (context.extension.startupReason === "APP_STARTUP") { | ||
ChromeUtils.import("resource://gre/modules/AddonManager.jsm"); | ||
const {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm"); | ||
|
||
AddonManager.getAddonsByTypes(["extension"]).then(addons => { | ||
for (const addon of addons) { | ||
if (addon.isActive && addon.dependencies.includes("[email protected]")) { | ||
addon.reload(); | ||
} | ||
if (addon.dependencies.includes("[email protected]")) { | ||
if (addon.isActive || addon.isActive === undefined) { | ||
console.log("Legacy Helper reloading addon: " + addon.name, addon); | ||
addon.reload(); | ||
} else { | ||
console.log("Skipping addon: " + addon.name, addon.isActive, addon); | ||
} | ||
} else { | ||
console.log("Skipping non-legacy addon: " + addon.name); | ||
} | ||
} | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Legacy Helper", | ||
"version": "0.1", | ||
"version": "0.2", | ||
"description": "Provides support for webextensions to access legacy-restricted functionality", | ||
"author": "Alex Vallat", | ||
|
||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]", | ||
"strict_min_version": "60.0", | ||
"strict_min_version": "67.0", | ||
"update_url": "https://raw.githubusercontent.com/AlexVallat/LegacyHelper/master/updates.json" | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
{ | ||
"addons": { | ||
"[email protected]": { | ||
"updates": [ | ||
{ | ||
"version": "0.1", | ||
"update_link": "https://github.com/AlexVallat/LegacyHelper/releases/download/v0.1/LegacyHelper.xpi" | ||
} | ||
] | ||
} | ||
} | ||
{ | ||
"addons": { | ||
"[email protected]": { | ||
"updates": [ | ||
{ | ||
"version": "0.1", | ||
"update_link": "https://github.com/AlexVallat/LegacyHelper/releases/download/v0.1/LegacyHelper.xpi" | ||
}, | ||
{ | ||
"version": "0.2", | ||
"update_link": "https://github.com/AlexVallat/LegacyHelper/releases/download/v0.2/LegacyHelper.xpi" | ||
} | ||
] | ||
} | ||
} | ||
} |