Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BrowserWindow extension API is not available on ready since 9 #23656

Closed
3 tasks done
ChALkeR opened this issue May 19, 2020 · 3 comments
Closed
3 tasks done

BrowserWindow extension API is not available on ready since 9 #23656

ChALkeR opened this issue May 19, 2020 · 3 comments

Comments

@ChALkeR
Copy link
Contributor

ChALkeR commented May 19, 2020

Preflight Checklist

Issue Details

  • Electron Version:
    • 9.0.0
  • Operating System:
    • Linux xps 5.6.11-arch1-1 #1 SMP PREEMPT Wed, 06 May 2020 17:32:37 +0000 x86_64 GNU/Linux (Arch Linux Current)
  • Last Known Working Electron version:
    • 8.3.0

Expected Behavior

Extension APIs should be available on BrowserWindow on app ready event, as documented.

Actual Behavior

Extension APIs are not available on app ready event but become available after a delay.

To Reproduce

const { BrowserWindow, app } = require('electron')
console.log(`Electron: ${process.versions.electron}`)
app.on('ready', async () => {
  console.log(`ready: ${Object.keys(BrowserWindow)}`)
  setImmediate(() => console.log(`timeout: ${Object.keys(BrowserWindow)}`))
})

Results:

Electron: 8.3.0
ready: fromId,getAllWindows,getFocusedWindow,fromWebContents,fromBrowserView,addExtension,removeExtension,getExtensions,addDevToolsExtension,removeDevToolsExtension,getDevToolsExtensions
timeout: fromId,getAllWindows,getFocusedWindow,fromWebContents,fromBrowserView,addExtension,removeExtension,getExtensions,addDevToolsExtension,removeDevToolsExtension,getDevToolsExtensions
Electron: 9.0.0
ready: fromId,getAllWindows,getFocusedWindow,fromWebContents,fromBrowserView
timeout: fromId,getAllWindows,getFocusedWindow,fromWebContents,fromBrowserView,addExtension,removeExtension,getExtensions,addDevToolsExtension,removeDevToolsExtension,getDevToolsExtensions
@ChALkeR
Copy link
Contributor Author

ChALkeR commented May 19, 2020

Also the docs should probably be updated to point to session.loadExtension instead.

bendemboski added a commit to adopted-ember-addons/ember-electron that referenced this issue May 20, 2020
Unfortunately, due to bugs in Electron 9, we can't use devtron (electron/electron#23676). We could at least get Ember Inspector to load (using the workaround for electron/electron#23656), but hopefully Electron will turn around a quick fix at least for that second issue so we don't have to add a temporary workaround to the blueprint-generated code...
@ChALkeR
Copy link
Contributor Author

ChALkeR commented May 21, 2020

To anyone reading this: this affects just the compatibility wrapper.

The correct "work-around" is not to wrap this call in setImmediate, but to use the new API: https://github.com/electron/electron/blob/master/docs/api/session.md#sesloadextensionpath

bendemboski added a commit to adopted-ember-addons/ember-electron that referenced this issue May 21, 2020
Unfortunately, due to bugs in Electron 9, we can't use devtron (electron/electron#23676). We could at least get Ember Inspector to load (using the workaround for electron/electron#23656), but hopefully Electron will turn around a quick fix at least for that second issue so we don't have to add a temporary workaround to the blueprint-generated code...
bendemboski added a commit to adopted-ember-addons/ember-electron that referenced this issue May 21, 2020
Unfortunately, due to bugs in Electron 9, we can't use devtron (electron/electron#23676). We could at least get Ember Inspector to load (using the workaround for electron/electron#23656), but hopefully Electron will turn around a quick fix at least for that second issue so we don't have to add a temporary workaround to the blueprint-generated code...
@ChALkeR
Copy link
Contributor Author

ChALkeR commented Jun 9, 2021

Let's close this as those were removed in main.
Refs: #26696

@ChALkeR ChALkeR closed this as completed Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants