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

don't share event loop between windows when possible #5857

Closed
akosyakov opened this issue Aug 5, 2019 · 5 comments · Fixed by #6683
Closed

don't share event loop between windows when possible #5857

akosyakov opened this issue Aug 5, 2019 · 5 comments · Fixed by #6683
Labels
help wanted issues meant to be picked up, require help mini-browser issues related to the mini-browser performance issues related to performance

Comments

@akosyakov
Copy link
Member

akosyakov commented Aug 5, 2019

All windows on the same origin share an event loop as they can synchronously communicate

from http://hassansin.github.io/shared-event-loop-among-same-origin-windows

As a consequence debugging in one window blocks all other windows for the same origin.

The obvious candidate is mini-browser. But we should review other places where we use window.open and pass rel=noopener when it makes sense, i.e. we did not need to communicate with an opened window.

@akosyakov akosyakov added the mini-browser issues related to the mini-browser label Aug 5, 2019
@akosyakov akosyakov added help wanted issues meant to be picked up, require help ui/ux issues related to user interface / user experience performance issues related to performance and removed ui/ux issues related to user interface / user experience labels Aug 5, 2019
@DanTup
Copy link
Contributor

DanTup commented Dec 3, 2019

I wish I'd found this earlier - I've been debugging this most of the morning 🙈 The issue is when we hit a breakpoint in the web app, it causes GitPod to lock up and everything hangs.

I tested adding 'noopener' as the third argument to window.open here and it solved my issue:

openNewWindow(url: string): Window | undefined {

However since this prevents it from returning a Window, it may make sense to change the interface to return void to avoid confusion (as far as I can tell, nothing is using the return value?).

@akosyakov
Copy link
Member Author

@DanTup Could you send a PR please? Changing a return type is fine. I could not find any clients using the returned window object.

DanTup added a commit to DanTup/theia that referenced this issue Dec 3, 2019
Prevents the web UI pausing when an app opened with window.open is paused in the browsers debugger.

Fixes eclipse-theia#5857.
@DanTup
Copy link
Contributor

DanTup commented Dec 3, 2019

@akosyakov I made a start, but I'm not getting very good errors in my IDE so I'm not sure if this is everything. I'm also not sure whether changing the undefineds to void throughout like this is desired?

DanTup@ce9c034

Does this seem reasonable?

@akosyakov
Copy link
Member Author

akosyakov commented Dec 3, 2019

I'm also not sure whether changing the undefineds to void throughout like this is desired?

OpenerService api should NOT be changed, it is used to open anything, not only a window, e.g. editors, preview widgets and so on. In such cases a widget will be returned. But other places look fine to me.

@DanTup
Copy link
Contributor

DanTup commented Dec 3, 2019

OpenerService api should be changed

I presume there's a missing "not" there? I'll revert that then and use undefined instead of void.

Does it seem ok removing the error-throwing code in default-window-service since it'll always get an undefined return value now?

btw, I don't know if I can reliably test all of this locally.. I tested the noopener change on GitPod by just using the dev console to replace window.open with a wrapper that did passed this arg.

DanTup added a commit to DanTup/theia that referenced this issue Dec 3, 2019
Prevents the web UI pausing when an app opened with window.open is paused in the browsers debugger.

Fixes eclipse-theia#5857.
DanTup added a commit to DanTup/theia that referenced this issue Dec 3, 2019
Prevents the web UI pausing when an app opened with window.open is paused in the browsers debugger.

Fixes eclipse-theia#5857.

Signed-off-by: Danny Tuppeny <danny@tuppeny.com>
DanTup added a commit to DanTup/theia that referenced this issue Dec 3, 2019
Prevents the web UI pausing when an app opened with window.open is paused in the browsers debugger.

Fixes eclipse-theia#5857.

Signed-off-by: Danny Tuppeny <danny@tuppeny.com>
kittaakos pushed a commit that referenced this issue Dec 3, 2019
Prevents the web UI pausing when an app opened with window.open is paused in the browsers debugger.

Fixes #5857.

Signed-off-by: Danny Tuppeny <danny@tuppeny.com>
akosyakov pushed a commit to akosyakov/theia that referenced this issue Feb 24, 2020
Prevents the web UI pausing when an app opened with window.open is paused in the browsers debugger.

Fixes eclipse-theia#5857.

Signed-off-by: Danny Tuppeny <danny@tuppeny.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted issues meant to be picked up, require help mini-browser issues related to the mini-browser performance issues related to performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants