Beaker: window.open does not work correctly

Created on 26 Oct 2018  路  6Comments  路  Source: beakerbrowser/beaker

Operation System:All OS
Beaker version:Version: 0.8.0 Electron: 3.0.4 - Chromium: 66.0.3359.181 - Node: 10.2.0

Steps to reproduce:
1) Open http://str.cloudn-service.com/dl.lunascape.jp/dl-lunascape/dl/Phoebe/work/sbi_test.html
2) Try checking the links below.

I recently came across this browser based on Electron. Our own product is based on Electron and we had this difficulty of implementing window.open into a new tab our browser. We got a workaround by changing the implementation of window.open in Electron by creating guest contents in Electron when window.open is opened. We then attached the created guest web contents to the web frame in the client side code by guestInstance. This worked fine until Electron v2.0.x.
In Electron v3.0.x, they have implemented OOPIF architecture recently. Here is a link for that
https://github.com/electron/electron/issues/14120.

I would love to know more about the implementation in Beaker regarding this issue and would be amazing to know more information about how we can workaround this issue.

Thank you.

Most helpful comment

Lol yeah hopefully it'll be a better experience. Window.open does seem to be working correctly but lmk if something's still off. (We still have an open issue about the window proxy object that's supposed to be returned)

All 6 comments

I don't know if that is what you need, but I have used the shell object from electron itself with its "openExternal(url)" function.

https://electronjs.org/docs/api/shell

const {shell} = require('electron')

shell.openExternal('https://github.com')

I used it this way:
I added a click event to the external links, and when they get clicked I just run shell.openExternal($(e.target).attr("href"))

Some Links:
https://stackoverflow.com/questions/32402327/how-can-i-force-external-links-from-browser-window-to-open-in-a-default-browser
https://stackoverflow.com/questions/35840347/open-external-file-with-os-default-application-docx-with-word-etc-using-nod

While I'm not entirely sure, I guess this is also how beaker is doing this. Might have to wait till @pfrazee tells us 馃槃

Hope this helps you out!
Julian

We use Electron's native open setting, but we have open issues because that's not a perfect solution. So, no good answers here.

@pfrazee could you explain it a bit more mate?

@puf17640 the problem is to open window.open as a new tab in the browser mate. There's no use opening it in a new window for us.

Thanks for the unintended reminder that beaker exists, gotta check out what changed in the last 2 years!

Lol yeah hopefully it'll be a better experience. Window.open does seem to be working correctly but lmk if something's still off. (We still have an open issue about the window proxy object that's supposed to be returned)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LWFlouisa picture LWFlouisa  路  4Comments

monteslu picture monteslu  路  3Comments

dasanchez picture dasanchez  路  3Comments

aaronshaf picture aaronshaf  路  4Comments

aaronshaf picture aaronshaf  路  3Comments