refactor: piggy-back on ELECTRON_BROWSER_SANDBOX_LOAD to get content scripts (#18823)
This commit is contained in:
parent
450aa33775
commit
edb56500c7
6 changed files with 17 additions and 12 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue