Open external window on android (window.open)

1,459 views
Skip to first unread message

HorstPotter

unread,
May 11, 2012, 11:30:56 AM5/11/12
to rhom...@googlegroups.com
Hello,

how do I enable 'setJavaScriptCanOpenWindowsAutomatically' for Android views?

I have to open external webpages with javascript in a NEW (browser-)window.

Window open does not work:
window.open(str_newUrl, "_blank");

Workaround does not work either:
var link = document.createElement('a');
link
.setAttribute('href', href);
link
.setAttribute('target','_blank');
var clickevent = document.createEvent('Event');
clickevent
.initEvent('click', true, false);
link
.dispatchEvent(clickevent);
return false;

On iOS both versions are opening external webpages in a new browser-window.

HorstPotter

unread,
Jun 4, 2012, 10:22:12 AM6/4/12
to rhom...@googlegroups.com
Any hints or tips for this topic?

Best regards.

Alexey Tikhvinsky

unread,
Jun 6, 2012, 7:57:33 AM6/6/12
to rhom...@googlegroups.com
Hi

You can do it from ruby with
System.open_url(url)
It will open the url in default browser window.

On android opening new webview windows is disabled.

-alexey

--
You received this message because you are subscribed to the Google Groups "rhomobile" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rhomobile/-/rl8mamLECz8J.

To post to this group, send email to rhom...@googlegroups.com.
To unsubscribe from this group, send email to rhomobile+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rhomobile?hl=en.



--
-alexey
Reply all
Reply to author
Forward
0 new messages