Skip to content

Commit

Permalink
manual pref optional warring hide
Browse files Browse the repository at this point in the history
  • Loading branch information
117649 committed May 20, 2021
1 parent 7c35215 commit caa2fa3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions AdvancedLocationbar/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,14 @@ function install(data, reason) {

function uninstall() { }

async function startup(data, reason) {
function startup(data, reason) {
var temp = {};
Services.scriptloader.loadSubScript("chrome://advancedlocationbar/content/prefs.js", temp, 'UTF-8');
delete temp;

var signedState = (await AddonManager.getAddonByID(`${data.id}`)).__AddonInternal__.signedState
Services.prefs.getBoolPref("extensions.advancedlocationbar.hide_warring") ?
signedState = AddonManager.SIGNEDSTATE_NOT_REQUIRED
:signedState === AddonManager.SIGNEDSTATE_NOT_REQUIRED ? signedState = AddonManager.SIGNEDSTATE_MISSING:'';

const window = Services.wm.getMostRecentWindow('navigator:browser');

// This may be relevant if colorMenu is used
if (reason === ADDON_UPGRADE || reason === ADDON_DOWNGRADE) {
showRestartNotifcation("upgraded", window);
return;
Expand Down Expand Up @@ -119,6 +114,13 @@ async function startup(data, reason) {
Services.obs.addObserver(documentObserver, "chrome-document-loaded");
})();

(async function () {
try {
Services.prefs.getBoolPref("extensions.advancedlocationbar.hide_warring") ?
(await AddonManager.getAddonByID(`${data.id}`)).__AddonInternal__.signedState = AddonManager.SIGNEDSTATE_NOT_REQUIRED
: (await AddonManager.getAddonByID(`${data.id}`)).__AddonInternal__.signedState === AddonManager.SIGNEDSTATE_NOT_REQUIRED ? (await AddonManager.getAddonByID(`${data.id}`)).__AddonInternal__.signedState = AddonManager.SIGNEDSTATE_MISSING : '';
} catch (error) { }
})();
}

function shutdown(data, reason) {
Expand Down

0 comments on commit caa2fa3

Please sign in to comment.