You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chrome-extension.js is a big, but ugly, file that holds big parts of logic. If we want to make the lib more easy to work on, we should refactor this file.
chrome-extension.js expose 2 public APIs:
addExtension(extensionId, srcDirectory)
removeExtension(extensionId)
addExtension is responsible for:
reading and interpreting manifest.json
starting background pages
instantiating API handlers via (fairly recent) ChromeAPIHandler for storage, webRequest, windows
defining some API handlers (legacy, to be moved to ChromeAPIHandler) for runtime, tabs, web navigation (others ?)
doing content scrips injection
doing content-security injection (?): seems very hacky
load devtools extension: hacky, needs to be done via support of chrome.devtools APIs
(outside chrome-extension.js): serve chrome-extension://* in engine/protocol
These responsibilities could be split into several modules.
The text was updated successfully, but these errors were encountered:
// responsible to provide assets (files, manifest..) of a given extensioninterfaceExtensionAssetsProvider{extensionId: stringasycngetManifest: ()=>object// readfile('main.html') will find `main.html` in extension folderreadFile: (relativePath)=>{mimeType: string,data: Stream}}interfaceBackgroundPagesManager(){start(extensionId: string,extensionsAssets: ExtensionAssetsProvider): BackgroundPage,stop(extensionId: string)}interfaceContentScriptsInjector(){addContentScriptsForExtension(extensionId: string,extensionsAssets: ExtensionAssetsProvider)removeContentScriptsForExtension(extensionId: string)}
chrome-extension.js
is a big, but ugly, file that holds big parts of logic. If we want to make the lib more easy to work on, we should refactor this file.chrome-extension.js
expose 2 public APIs:addExtension(extensionId, srcDirectory)
removeExtension(extensionId)
addExtension
is responsible for:manifest.json
ChromeAPIHandler
forstorage
,webRequest
,windows
ChromeAPIHandler
) forruntime
,tabs
,web navigation
(others ?)hacky, needs to be done via support ofchrome.devtools
APIschrome-extension.js
): servechrome-extension://*
inengine/protocol
These responsibilities could be split into several modules.
The text was updated successfully, but these errors were encountered: