chore: disable JS impl when //extensions support is on (#19512)

This commit is contained in:
Jeremy Apthorp 2019-07-31 14:25:41 -07:00 committed by GitHub
parent a5f87cee6b
commit c71cdce0b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 50 additions and 9 deletions

View file

@ -67,6 +67,10 @@ class Port {
// Inject chrome API to the |context|
export function injectTo (extensionId: string, context: any) {
if (process.electronBinding('features').isExtensionsEnabled()) {
throw new Error('Attempted to load JS chrome-extension polyfill with //extensions support enabled')
}
const chrome = context.chrome = context.chrome || {}
ipcRendererInternal.on(`CHROME_RUNTIME_ONCONNECT_${extensionId}`, (