Chrome Extension Support
Electron only supports loading unpacked extensions (i.e., .crx
files do not work). Extensions are installed per-session
. To load an extension, call :
Loaded extensions will not be automatically remembered across exits; if you do not call loadExtension
when the app runs, the extension will not be loaded.
Note that loading extensions is only supported in persistent sessions. Attempting to load an extension into an in-memory session will throw an error.
See the session
documentation for more information about loading, unloading, and querying active extensions.
Supported Extensions APIs
All features of this API are supported.
chrome.devtools.network
All features of this API are supported.
All features of this API are supported.
chrome.extension
The following properties of chrome.extension
are supported:
chrome.extension.lastError
The following methods of are supported:
chrome.extension.getBackgroundPage
chrome.runtime.lastError
chrome.runtime.id
The following methods of chrome.runtime
are supported:
chrome.runtime.getBackgroundPage
chrome.runtime.getManifest
chrome.runtime.getURL
chrome.runtime.connect
chrome.runtime.sendMessage
The following events of chrome.runtime
are supported:
chrome.runtime.onStartup
chrome.runtime.onInstalled
chrome.runtime.onSuspend
chrome.runtime.onConnect
chrome.storage
Only chrome.storage.local
is supported; chrome.storage.sync
and chrome.storage.managed
are not.
The following methods of chrome.tabs
are supported:
chrome.tabs.sendMessage
chrome.tabs.executeScript
Note: In Chrome, passing
-1
as a tab ID signifies the “currently active tab”. Since Electron has no such concept, passing-1
as a tab ID is not supported and will raise an error.
chrome.management
chrome.management.getAll
chrome.management.get
chrome.management.getSelf
chrome.management.getPermissionWarningsById
chrome.management.getPermissionWarningsByManifest
chrome.management.onEnabled