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

Upgrade to Electron 15 #377

Merged
merged 9 commits into from
Feb 16, 2022
Merged

Upgrade to Electron 15 #377

merged 9 commits into from
Feb 16, 2022

Conversation

krassowski
Copy link
Member

Looks like this one will be easy. Electron 15 blog post: https://www.electronjs.org/blog/electron-15-0
We are getting straight to 15.3.4.

Full changelog for 15.0.0: https://www.electronjs.org/releases/stable?page=3#15.0.0

Stack:

  • Chromium 93 → 94
  • Node v14.17.0 → v16.5.0
  • V8: v9.3 → v9.4

mbektas
mbektas previously approved these changes Dec 20, 2021
Copy link
Member

@mbektas mbektas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks!

@mbektas mbektas dismissed their stale review December 20, 2021 01:26

it didn't work for me on Mac

@mbektas
Copy link
Member

mbektas commented Dec 20, 2021

I am getting kernel related errors once I install and test on my Mac when I try running cells. Released version 3.2.5-2 works fine on the same machine.

electron 15 problem

@krassowski
Copy link
Member Author

I can reproduce Error during WebSocket handshake: Unexpected response code 403. Nothing I tried so far helped:

  • nativeWindowOpen: false in BrowserWindow constructor
  • --ServerApp.allow_remote_access=True
  • --log_level=DEBUG to check if the message gets received by the server and if there is more logs (it does not seem to be)
  • downgrading Electron to 15.0.0
  • setting custom CORS

I will appreciate any suggestions on how to tackle this one.

@mbektas
Copy link
Member

mbektas commented Jan 15, 2022

@krassowski can you rebase your branch so we can get test binaries with changes in #387?

@krassowski
Copy link
Member Author

Done

@mbektas
Copy link
Member

mbektas commented Jan 15, 2022

Thanks @krassowski . I tested on Mac and noticing two issues:

  • PDF documents are not opening anymore
  • After switching to Classic notebooks and clicking on a notebook opens a blank window
    could you look into these please?

@mbektas
Copy link
Member

mbektas commented Jan 15, 2022

Thanks @krassowski . I tested on Mac and noticing two issues:

  • PDF documents are not opening anymore
  • After switching to Classic notebooks and clicking on a notebook opens a blank window
    could you look into these please?

just checked the same with #387 and both work fine with those changes. so that makes me think these are failing maybe because of additional security measures in electron 15?

@mbektas
Copy link
Member

mbektas commented Feb 4, 2022

@krassowski atob change was necessary to get PDFs to open properly. PDF content is returned in base64 format from contents API but it contains whitespaces. This base64 content is converted to binary blob to render. atob function is used in the process. External browser's implementation of atob permits whitespaces. Since Desktop app creates BrowserWindow without context isolation, atob from node.js is exposed to browser window. atob of node.js does not permit whitespaces and causes PDF blob generation to fail. with my changes I am introducing a modified version of atob of node.js which allows whitespaces. Once we turn on contextIsolation, this patch wouldn't be needed anymore.

src/main/main.ts Outdated
@@ -190,10 +190,13 @@ app.on('ready', () => {
});

app.on("web-contents-created", (_event: any, webContents: WebContents) => {
// Prevent navigation
// Prevent navigation to local links
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krassowski do you have any concerns on these changes? any concerns navigating to external websites?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am concerned. Wouldn't this lead to a context leak? Why is this change needed, again?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

during my testing, external domain urls were opened in popup windows and that is safe, so I thought we could enable it back. but if you think there are cases that require blocking external urls then I can update it to block. The original motivation for this change was the issue I mentioned in earlier comments: After switching to Classic notebooks and clicking on a notebook opens a blank window

@krassowski
Copy link
Member Author

atob function is used in the process. External browser's implementation of atob permits whitespaces. Since Desktop app creates BrowserWindow without context isolation, atob from node.js is exposed to browser window.

Was it a change in Electron 15 which lead to this?

@mbektas
Copy link
Member

mbektas commented Feb 12, 2022

yes, atob issue turns out to be caused by Electron 15 upgrade.

@krassowski
Copy link
Member Author

How about krassowski#15 ?

krassowski and others added 2 commits February 14, 2022 11:30
@mbektas mbektas merged commit 6980447 into jupyterlab:master Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants