(options: {runOnProtectedPages: boolean})
| 406 | } |
| 407 | |
| 408 | static async updateContentScript(options: {runOnProtectedPages: boolean}): Promise<void> { |
| 409 | (await queryTabs({discarded: false})) |
| 410 | .filter((tab) => __CHROMIUM_MV3__ || options.runOnProtectedPages || canInjectScript(tab.url)) |
| 411 | .filter((tab) => !TabManager.tabs[tab.id!]) |
| 412 | .forEach((tab) => { |
| 413 | if (__CHROMIUM_MV3__) { |
| 414 | chrome.scripting.executeScript({ |
| 415 | target: { |
| 416 | tabId: tab.id!, |
| 417 | allFrames: true, |
| 418 | }, |
| 419 | files: ['/inject/index.js'], |
| 420 | }, () => logInfo('Could not update content script in tab', tab, chrome.runtime.lastError)); |
| 421 | } else { |
| 422 | chrome.tabs.executeScript(tab.id!, { |
| 423 | runAt: 'document_start', |
| 424 | file: '/inject/index.js', |
| 425 | allFrames: true, |
| 426 | matchAboutBlank: true, |
| 427 | }); |
| 428 | } |
| 429 | }); |
| 430 | } |
| 431 | |
| 432 | static async registerMailDisplayScript(): Promise<void> { |
| 433 | await (chrome as any).messageDisplayScripts.register({ |
no test coverage detected