refactor: piggy-back on ELECTRON_BROWSER_SANDBOX_LOAD to get content scripts (#18823)

This commit is contained in:
Milan Burda 2019-06-19 17:23:44 +02:00 committed by Alexey Kuzmin
parent 450aa33775
commit edb56500c7
6 changed files with 17 additions and 12 deletions

View file

@ -108,13 +108,7 @@ ipcRendererUtils.handle('CHROME_TABS_EXECUTE_SCRIPT', function (
return runContentScript.call(window, extensionId, url, code)
})
type ContentScriptEntry = {
extensionId: string;
contentScripts: Electron.ContentScript[];
}
module.exports = () => {
const entries = ipcRendererUtils.invokeSync<ContentScriptEntry[]>('CHROME_GET_CONTENT_SCRIPTS')
module.exports = (entries: Electron.ContentScriptEntry[]) => {
for (const entry of entries) {
if (entry.contentScripts) {
for (const script of entry.contentScripts) {