{"id":15683451,"url":"https://github.com/agregoreweb/electron-extended-webextensions","last_synced_at":"2025-07-04T02:37:13.268Z","repository":{"id":104840096,"uuid":"489480569","full_name":"AgregoreWeb/electron-extended-WebExtensions","owner":"AgregoreWeb","description":"Extend the built-in functionality of Electron Web Extensions with additional features commonly used by browsers.","archived":false,"fork":false,"pushed_at":"2022-06-16T22:52:40.000Z","size":118,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T12:24:29.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AgregoreWeb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-06T20:07:34.000Z","updated_at":"2023-11-03T13:57:59.000Z","dependencies_parsed_at":"2023-06-06T17:00:38.822Z","dependency_job_id":null,"html_url":"https://github.com/AgregoreWeb/electron-extended-WebExtensions","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.04761904761904767,"last_synced_commit":"6223649b6b2e8580f2cac3f00a83e19a0b45fef1"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgregoreWeb%2Felectron-extended-WebExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgregoreWeb%2Felectron-extended-WebExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgregoreWeb%2Felectron-extended-WebExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgregoreWeb%2Felectron-extended-WebExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgregoreWeb","download_url":"https://codeload.github.com/AgregoreWeb/electron-extended-WebExtensions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246306547,"owners_count":20756320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:05:36.289Z","updated_at":"2025-03-30T10:28:27.791Z","avatar_url":"https://github.com/AgregoreWeb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# electron-extended-WebExtensions\nExtend the built-in functionality of Electron Web Extensions with additional features commonly used by browsers.\n\n### Application APIs\n\nHere's what you need to use in order to integrate this module\n\n```JavaScript\nconst { ExtendedExtensions } = require('electron-extended-WebExtensions')\n\n// Pass in an Electron `Session` object you wish to attach to.\n// If you're not sure, use the default one `session.defaultSession`\nconst extensions = new ExtendedExtensions(session, {\n  // Handle when the system expects a new tab to be created\n  // `popup` is set to `true` when it's a popup for a browser action\n  // `openerTabId` is set to the id of the parent tab (if applicable)\n  // You should return an Electron WebContents instance so it can be tracked\n  onCreateTab: async ({url, popup=false, openerTabId}) =\u003e WebContents,\n})\n\n// Pass an absolute path to load an extension\n// This will also attach necessary injected APIs to it\nconst extension = await extension.loadExtension(path)\n\n// You can unload an extension at runtime by passing it's id\nawait extensions.unloadExtensions(extension.id)\n\n// Listen for context menu events and get the list of menu items to add\nwebContents.on('context-menu', (event, params) =\u003e {\n  const extensionMenuItems = extensions.contextMenus.getForEvent(webContents, event, params)\n  // You might want to add some of your own context menu items\n  // Could be useful in combination with https://github.com/sindresorhus/electron-context-menu\n  Menu.buildFromTemplate(extensionMenuItems).popup()\n})\n\n// When you set up browser windows, you'll likely want to render browser actions\nextensions.browserActions.list()\n\n// Extensions may set custom browser actions for a tab\n// You can fetch the tab-specific actions with this:\nextensions.browserActions.list(webContents.id)\n\n// Browser Action objects look something like this:\nconst action = {\n  // Track this to notify the system of clicks\n  extensionId,\n  extensionURL,\n  // Disabled items aren't usually listed\n  enabled: true,\n  // This text is usually displayed as image alt text upon hovering\n  title,\n  // This is the popup URL if one exists\n  // Mostly handled internally by the system\n  popup,\n  // This is the \"badge text\", it can get update periodically\n  text: '0',\n  // This is the icon you should render for the browser action\n  icon: 'chrome-extension://idhere/image.png',\n}\n\n// When users click on the Browser Action UI, notify the system with this:\n// The `webcontents.id` should be the id of the web contents that the click was performed for (the active tab)\nextensions.browserActions.click(extensionId, webContents.id)\n```\n\n\n## TODO\n\nItems with a question mark might not happen or are low priority\n\n- Try to reuse the [Electron Extensions](https://www.electronjs.org/docs/latest/api/extensions/) API\n- Manifestv2\n- Support APIs used by [WebRecorder](https://github.com/webrecorder/archiveweb.page/search?q=chrome)\n- [x] Support background pages\n\t- [x] Spawn background page\n\t- [x] Provide extension APIs to it\n\t\t- [x] Tabs\n\t\t- [x] Debugger\n\t\t- [x] Context Menu\n\t\t- [x] Browser Action\n\t\t- [x] webRequest (doesn't work on custom protocols yet, built in)\n- [x] Support content scripts\n\t- [x] Run content scripts (doesn't work on custom protocols yet, built in)\n\t- [x] Provide extension APIs\n\t\t- `runtime.connect` and friends\n- [ ] Support popup APIs\n- [x] Support BrowserActions\n\t- [x] Ability to specify BrowserAction in manifest\n\t- [x] List browser actions from electron app, listen for triggers\n\t- [x] Send browser action event to background page\n\t- [x] Open link on browser action\n\t- [ ] chrome.browserAction.setBackgroundColor\n- [x] contextMenu API\n\t- [x] create()\n\t- [x] update()\n\t- [x] remove()\n\t- [x] onClicked()\n\t- [ ] Support url patterns for filtering (todo)\n- [x] webNavigation API\n\t- [x] onBeoreNavigate\n\t- [x] onCommitted\n\t- [x] onDOMContentLoaded\n\t- [x] onCompleted\n\t- [x] onErrorOccured\n\t- [x] getFrame()\n\t- [x] getAllFrames()\n\t- [ ] Support url patterns for filtering (todo)\n\t- historyStateUpdated/createdNavigationTarget,referenceFragment will be TODO\n- [ ] Extend Tabs API:\n\t- [x] Built in support has sendMessage, reload, executeScript, update\n\t- [x] get, query, create, remove\n\t- [x] onActivated/onCreated/onRemoved/onUpdated\n\t- [x] executeScript got overrided in order to support custom protocols (for Agregore)\n\t- captureTab?\n\t- insertCSS / removeCSS?\n\t- getCurrent?\n\t- goBack/goForward?\n- [x] Support [debugger API](https://developer.chrome.com/docs/extensions/reference/debugger/) needed by WebRecorder\n- [ ] Support interacting with pages using [Custom Protocols Handlers](https://github.com/electron/electron/issues/23616)\n- [ ] Notifications API? https://www.electronjs.org/docs/latest/api/notification\n- Other APIs? Open an issue or a PR.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagregoreweb%2Felectron-extended-webextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagregoreweb%2Felectron-extended-webextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagregoreweb%2Felectron-extended-webextensions/lists"}