Welcome Guest Search | Active Topics | Sign In | Register

Using window.open with javascript for the TargetUrl Options
Chris
Posted: Monday, August 13, 2018 11:43:18 AM
Rank: Newbie
Groups: Member

Joined: 8/13/2018
Posts: 4
I've got an application that uses the EO browser that I am working on upgrading from a 17.x license to the newest 18.x license. We have some javascript code that opens a new window and writes content to it.

Code: JavaScript
var h = '<html><head><title>View</title></head><body style="margin:0;overflow:hidden"cmt:f2574143-231b-468f-b00b-89b67ae17b34--Simple Test</body></html>';
window.open('javascript:window.document.write(' + "'" + h + "'" + ');', 'view');


HTML pasted into this message does not want to display correctly - the HTML is sound though.

This code worked fine with the 17.x version, but with the 18.x version it does not. Instead, a new window is opened but the body is empty. There are no javascript errors being thrown that I can find. I do have a NewWindow event handler, and it has not changed. If I break inside that handler, the TargetUrl property is set to 'about:blank' but the javascript I passed in appears to have been thrown away.

I can't find anything in the docs that indicates this shouldn't be allowed now. Any suggestions?
eo_support
Posted: Monday, August 13, 2018 2:51:20 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

The most likely reason is due to some security changes in the Chromium browser engine. I would recommend you to try exactly the same code with the latest Google Chrome browser and see if it works. If that does not work, then it's definitely the browser engine and you should find another way to do it. This is because generally if the Chromium team decides to do thing in certain way, we have to follow it ---- otherwise we will have other user asking us why Chrome browser does it this way and our product does it that way.

If the same code works fine in Google Chrome browser but not in EO.WebBrowser, then you can try to isolate the problem into a separate test project and send the test project to us. See here for more information on how to send test project to us:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have that we will be happy to investigate further.

Thanks!
Chris
Posted: Tuesday, August 14, 2018 12:32:14 PM
Rank: Newbie
Groups: Member

Joined: 8/13/2018
Posts: 4
Thanks. I'll try setting up a test with Chrome.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.