Skip to content

Commit

Permalink
Make all options of register-self sticky #3666
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Dec 9, 2024
1 parent 0e8180f commit f6e049e
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions webextensions/common/tst-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,19 @@ function registerAddon(id, addon) {
// inherit properties from last effective value
const oldAddon = getAddon(id);
if (oldAddon) {
if (!('listeningTypes' in addon) && 'listeningTypes' in oldAddon)
addon.listeningTypes = oldAddon.listeningTypes;
if (!('style' in addon) && 'style' in oldAddon)
addon.style = oldAddon.style;
if (!('allowBulkMessaging' in addon) && 'allowBulkMessaging' in oldAddon)
addon.allowBulkMessaging = oldAddon.allowBulkMessaging;
if (!('lightTree' in addon) && 'lightTree' in oldAddon)
addon.lightTree = oldAddon.lightTree;
for (const param of [
'name',
'icons',
'listeningTypes',
'allowBulkMessaging',
'lightTree',
'style',
'permissions',
]) {
if (!(param in addon) && param in oldAddon) {
addon[param] = oldAddon[param];
}
}
}

if (!addon.listeningTypes) {
Expand Down

0 comments on commit f6e049e

Please sign in to comment.