@@ -52,22 +52,20 @@ export class Background {
5252 heartbeat,
5353 telemetry,
5454 } : Cradle ) {
55- Object . assign ( this , {
56- browser,
57- browserName,
58- walletService,
59- monetizationService,
60- storage,
61- sendToPopup,
62- sendToApp,
63- tabState,
64- tabEvents,
65- windowState,
66- logger,
67- events,
68- heartbeat,
69- telemetry,
70- } ) ;
55+ this . browser = browser ;
56+ this . browserName = browserName ;
57+ this . walletService = walletService ;
58+ this . monetizationService = monetizationService ;
59+ this . storage = storage ;
60+ this . sendToPopup = sendToPopup ;
61+ this . sendToApp = sendToApp ;
62+ this . tabState = tabState ;
63+ this . tabEvents = tabEvents ;
64+ this . windowState = windowState ;
65+ this . logger = logger ;
66+ this . events = events ;
67+ this . heartbeat = heartbeat ;
68+ this . telemetry = telemetry ;
7169 }
7270
7371 async start ( ) {
@@ -219,10 +217,8 @@ export class Background {
219217 }
220218
221219 // TODO: type ReturnType based on message
222- onMessage = async (
223- message : ToBackgroundMessage ,
224- sender : Runtime . MessageSender ,
225- ) => {
220+ onMessage = async ( msg : unknown , sender : Runtime . MessageSender ) => {
221+ const message = msg as ToBackgroundMessage ;
226222 this . logger . debug ( 'Received message' , message . action , message . payload ) ;
227223 try {
228224 switch ( message . action ) {
@@ -511,7 +507,9 @@ export class Background {
511507 }
512508
513509 const allTabs = await this . browser . tabs . query ( { } ) ;
514- const tabs = allTabs . filter ( ( t ) => t . id && t . url && isSecureContext ( t . url ) ) ;
510+ const tabs = allTabs . filter (
511+ ( t ) => t . id && t . url && isSecureContext ( t . url ) ,
512+ ) as Tab [ ] ;
515513 const injectPolyfill = ( tab : Tab ) => {
516514 return this . browser . scripting . executeScript ( {
517515 target : { tabId : tab . id } ,
0 commit comments