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

feat(android): new WebView property 'multipleWindows' #14005

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Mar 8, 2024

For 14 years the default value for setSupportMultipleWindows() is true which always tries to create new windows when clicking on a link with target _blank inside a webview. That breaks most webviews so you have to remove target="_blank" or change JS.

The new property multipleWindows will allow the user to just set it to false

Test

var win = Ti.UI.createWindow();
var www = Ti.UI.createWebView({
  multipleWindows: false,
  html:"<div onclick=\"window.open('https://player.autopod.xyz/523959', '_blank', 'location=yes,height=810,width=470,scrollbars=no, resizable=no,status=yes');\">click me</div>"
});

win.add(www);
win.open();

In 12.3.0.GA or if you set it to true (default) it will just show a new black page. If you set it to false it will open the link in the same window/webview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant