@@ -90,35 +90,20 @@ function doublePipe(one, two) {
90
90
}
91
91
92
92
function setIconAndPopup ( reactBuildType , tabId ) {
93
- if ( IS_FIREFOX ) {
94
- chrome . browserAction . setIcon ( {
95
- tabId : tabId ,
96
- path : {
97
- '16' : chrome . runtime . getURL ( `icons/16-${ reactBuildType } .png` ) ,
98
- '32' : chrome . runtime . getURL ( `icons/32-${ reactBuildType } .png` ) ,
99
- '48' : chrome . runtime . getURL ( `icons/48-${ reactBuildType } .png` ) ,
100
- '128' : chrome . runtime . getURL ( `icons/128-${ reactBuildType } .png` ) ,
101
- } ,
102
- } ) ;
103
- chrome . browserAction . setPopup ( {
104
- tabId : tabId ,
105
- popup : chrome . runtime . getURL ( `popups/${ reactBuildType } .html` ) ,
106
- } ) ;
107
- } else {
108
- chrome . action . setIcon ( {
109
- tabId : tabId ,
110
- path : {
111
- '16' : chrome . runtime . getURL ( `icons/16-${ reactBuildType } .png` ) ,
112
- '32' : chrome . runtime . getURL ( `icons/32-${ reactBuildType } .png` ) ,
113
- '48' : chrome . runtime . getURL ( `icons/48-${ reactBuildType } .png` ) ,
114
- '128' : chrome . runtime . getURL ( `icons/128-${ reactBuildType } .png` ) ,
115
- } ,
116
- } ) ;
117
- chrome . action . setPopup ( {
118
- tabId : tabId ,
119
- popup : chrome . runtime . getURL ( `popups/${ reactBuildType } .html` ) ,
120
- } ) ;
121
- }
93
+ const action = IS_FIREFOX ? chrome . browserAction : chrome . action ;
94
+ action . setIcon ( {
95
+ tabId : tabId ,
96
+ path : {
97
+ '16' : chrome . runtime . getURL ( `icons/16-${ reactBuildType } .png` ) ,
98
+ '32' : chrome . runtime . getURL ( `icons/32-${ reactBuildType } .png` ) ,
99
+ '48' : chrome . runtime . getURL ( `icons/48-${ reactBuildType } .png` ) ,
100
+ '128' : chrome . runtime . getURL ( `icons/128-${ reactBuildType } .png` ) ,
101
+ } ,
102
+ } ) ;
103
+ action . setPopup ( {
104
+ tabId : tabId ,
105
+ popup : chrome . runtime . getURL ( `popups/${ reactBuildType } .html` ) ,
106
+ } ) ;
122
107
}
123
108
124
109
function isRestrictedBrowserPage ( url ) {
0 commit comments