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 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,11 @@ public TiUIWebView(TiViewProxy proxy)
}
webView.setVerticalScrollbarOverlay(true);

boolean multipleWindows = TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_MULTIPLE_WINDOWS), true);
WebSettings settings = webView.getSettings();
settings.setUseWideViewPort(true);
settings.setJavaScriptEnabled(true);
settings.setSupportMultipleWindows(true);
settings.setSupportMultipleWindows(multipleWindows);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setLoadsImagesAutomatically(true);
settings.setDomStorageEnabled(true); // Required by some sites such as Twitter. This is in our iOS WebView too.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ public class TiC
public static final String PROPERTY_MOVEABLE = "moveable";
public static final String PROPERTY_MOVING = "moving";
public static final String PROPERTY_MULTIPLY = "multiply";
public static final String PROPERTY_MULTIPLE_WINDOWS = "multipleWindows";
public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_NATIVE_SPINNER = "nativeSpinner";
public static final String PROPERTY_NAVIGATION_ICON = "navigationIcon";
Expand Down
8 changes: 8 additions & 0 deletions apidoc/Titanium/UI/WebView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,14 @@ properties:
default: false
availability: creation

- name: multipleWindows
summary: Set it to `false` to prevent the WebView to open new windows.
type: Boolean
platforms: [android]
since: "12.4.0"
default: true
availability: creation

- name: scalesPageToFit
summary: If `true`, scale contents to fit the web view.
description: |
Expand Down