@@ -136,30 +136,10 @@ export default class Background {
136
136
this . LOGGER . info ( 'disabling tab once.' , tabId ) ;
137
137
}
138
138
139
- static async getGlobalVariable ( variableName : string , sender , sendResponse ) {
140
- const [ { result } ] = await chrome . scripting . executeScript ( {
141
- func : this . getWindowVariable ,
142
- args : [ variableName ] ,
143
- target : { tabId : sender . tab . id , frameIds : [ sender . frameId ] } ,
144
- world : 'MAIN' ,
145
- } ) ;
146
- sendResponse ( result ) ;
147
- }
148
-
149
139
static getTabOptions ( storage : BackgroundStorage , tabId : number ) : TabStorageOptions {
150
140
return storage . tabs [ tabId ] || this . newTabOptions ( storage , tabId ) ;
151
141
}
152
142
153
- // variableName Supports '.' notation for nested values: window.nested.value
154
- static getWindowVariable ( variableName : string ) {
155
- try {
156
- const properties = variableName . split ( '.' ) ;
157
- return properties . reduce ( ( prev , curr ) => prev && prev [ curr ] , window ) ;
158
- } catch {
159
- return null ;
160
- }
161
- }
162
-
163
143
static async handleBackgroundDataRequest ( request : Message , sender : chrome . runtime . MessageSender , sendResponse ) {
164
144
const storage = await this . loadBackgroundStorage ( ) ;
165
145
const tabId = request . source == this . Constants . MESSAGING . CONTEXT ? sender . tab . id : request . tabId ;
@@ -284,11 +264,9 @@ export default class Background {
284
264
} else if ( request . fetch ) {
285
265
this . handleRequest ( request . fetch , request . fetchMethod , sendResponse ) ;
286
266
return true ; // return true when waiting on an async call
287
- } else if ( request . globalVariable ) {
288
- this . getGlobalVariable ( request . globalVariable , sender , sendResponse ) ;
289
- return true ; // return true when waiting on an async call
290
267
} else {
291
268
this . onContextMessageElse ( chromeAction , request , sender , sendResponse ) ;
269
+ return true ; // return true when waiting on an async call
292
270
}
293
271
break ;
294
272
0 commit comments