Skip to content

Instantly share code, notes, and snippets.

@daleharvey
Last active March 23, 2020 21:12
Show Gist options
  • Save daleharvey/e6de5395a4d06aeeb64e67a56358aaf6 to your computer and use it in GitHub Desktop.
Save daleharvey/e6de5395a4d06aeeb64e67a56358aaf6 to your computer and use it in GitHub Desktop.
// test.js:
dump("!!! ABOUT TO CALL UPGRADE\n");
await extension.upgrade(extInfo("example", "Example", "2.0"));
dump("!!! CALLED UPGRADE\n");
// ext-chrome-settings-overrides.js:
dump("!!!! addSearchEngine - 4\n");
// Get position of engine and store it
let enginesList = await Services.search.getEngines();
dump("!!!! addSearchEngine - 4.5\n");
index = enginesList.map(engine => engine.name).indexOf(firstEngineName);
dump("!!!! addSearchEngine - 5\n");
await Services.search.removeEngine(firstEngine);
// console output
0:01.93 pid:83858 !!! ABOUT TO CALL UPGRADE
0:01.96 pid:83858 !!!! processSearchProviderManifestEntry
0:01.96 pid:83858 !!!! addSearchEngine - 4
0:01.96 pid:83858 !!! CALLED UPGRADE
0:01.96 INFO exiting test
0:01.97 pid:83858 !!!! addSearchEngine - 4.5
0:01.97 pid:83858 !!!! addSearchEngine - 5
0:01.97 pid:83858 !!!! RemoveEngine Called
0:01.97 pid:83858 !!!! addEnginesFromExtension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment