Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c09faee9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clarify docs for WebView multiwindow settings." into main

parents 94abf8c1 6746c20a
Loading
Loading
Loading
Loading
+23 −9
Original line number Original line Diff line number Diff line
@@ -741,9 +741,17 @@ public abstract class WebSettings {
    public abstract boolean getUseWideViewPort();
    public abstract boolean getUseWideViewPort();


    /**
    /**
     * Sets whether the WebView whether supports multiple windows. If set to
     * Sets whether the WebView should support multiple windows.
     * true, {@link WebChromeClient#onCreateWindow} must be implemented by the
     *
     * host application. The default is {@code false}.
     * <p>If set to {@code true}, the {@link WebChromeClient#onCreateWindow}
     * callback must be implemented by the application to handle the
     * creation of new windows.
     *
     * <p>The default is {@code false}. When multiple window support is disabled,
     * requests to open new windows (either from the {@code window.open()}
     * JavaScript API or from links with {@code target="_blank"}) will instead
     * be treated as top-level navigations, replacing the current page in the
     * same WebView.
     *
     *
     * @param support whether to support multiple windows
     * @param support whether to support multiple windows
     */
     */
@@ -1338,18 +1346,24 @@ public abstract class WebSettings {
    }
    }


    /**
    /**
     * Tells JavaScript to open windows automatically. This applies to the
     * Allows JavaScript to open windows without a user gesture. This applies to
     * JavaScript function {@code window.open()}. The default is {@code false}.
     * the JavaScript function {@code window.open()}. The default is
     * {@code false}: attempts without a user gesture will fail and do nothing.
     * <p>
     * This is not affected by the {@link #setSupportMultipleWindows} setting;
     * the user gesture requirement is enforced even if multiple windows are
     * disabled.
     *
     *
     * @param flag {@code true} if JavaScript can open windows automatically
     * @param flag {@code true} if JavaScript can open windows without a user
     *             gesture.
     */
     */
    public abstract void setJavaScriptCanOpenWindowsAutomatically(boolean flag);
    public abstract void setJavaScriptCanOpenWindowsAutomatically(boolean flag);


    /**
    /**
     * Gets whether JavaScript can open windows automatically.
     * Gets whether JavaScript can open windows without a user gesture.
     *
     *
     * @return {@code true} if JavaScript can open windows automatically during
     * @return {@code true} if JavaScript can open windows without a user
     *         {@code window.open()}
     *         gesture using {@code window.open()}
     * @see #setJavaScriptCanOpenWindowsAutomatically
     * @see #setJavaScriptCanOpenWindowsAutomatically
     */
     */
    public abstract boolean getJavaScriptCanOpenWindowsAutomatically();
    public abstract boolean getJavaScriptCanOpenWindowsAutomatically();