File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ browser.runtime.onMessage.addListener((message, sender) => {
9696 restoreOptions ( tab ) ; // Apply new settings in each tab
9797 } ) ;
9898 } ) ;
99+ case "update-action-icon" : // When the user adds a new custom setting
100+ browser . tabs . query ( { active : true , currentWindow : true } , tabs => {
101+ update_action_icon ( { tabId : tabs [ 0 ] . id } ) // Update icon
102+ } ) ;
99103 break ;
100104 // case "display-notification": // When the user saves the settings (from popup)
101105 // browser.notifications.create(message.notificationName, message.notification);
Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ function addCustom() {
6969 select . appendChild ( optionToAdd ) ; // Append new option to select
7070 select . value = custom_url ;
7171 select . dispatchEvent ( new Event ( 'change' ) ) ;
72+ browser . runtime . sendMessage ( { // Send message to background script asking to update the action icon
73+ request : "update-action-icon"
74+ } ) ;
7275 } , onError ) ;
7376} ;
7477
@@ -98,6 +101,9 @@ function removeCustom() {
98101 document . querySelector ( 'div#textShadowOptions' ) . style . display = "none" ;
99102 }
100103 updatePreview ( ) ; // Update preview
104+ browser . runtime . sendMessage ( { // Send message to background script asking to update the action icon
105+ request : "update-action-icon"
106+ } ) ;
101107 } , onError ) ;
102108} ;
103109
You can’t perform that action at this time.
0 commit comments