Package apple.webkit

Class WKWebView

    • Constructor Detail

      • WKWebView

        protected WKWebView​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static WKWebView allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • appearance

        @NotNull
        public static @NotNull WKWebView appearance()
      • appearanceForTraitCollection

        @NotNull
        public static @NotNull WKWebView appearanceForTraitCollection​(@NotNull
                                                                      @NotNull UITraitCollection trait)
      • appearanceForTraitCollectionWhenContainedIn

        @NotNull
        @Deprecated
        public static @NotNull WKWebView appearanceForTraitCollectionWhenContainedIn​(@NotNull
                                                                                     @NotNull UITraitCollection trait,
                                                                                     @Nullable
                                                                                     @Nullable UIAppearanceContainer ContainerClass,
                                                                                     java.lang.Object... varargs)
        Deprecated.
      • appearanceForTraitCollectionWhenContainedInInstancesOfClasses

        @NotNull
        public static @NotNull WKWebView appearanceForTraitCollectionWhenContainedInInstancesOfClasses​(@NotNull
                                                                                                       @NotNull UITraitCollection trait,
                                                                                                       @NotNull
                                                                                                       @NotNull NSArray<?> containerTypes)
      • appearanceWhenContainedIn

        @NotNull
        @Deprecated
        public static @NotNull WKWebView appearanceWhenContainedIn​(@Nullable
                                                                   @Nullable UIAppearanceContainer ContainerClass,
                                                                   java.lang.Object... varargs)
        Deprecated.
      • appearanceWhenContainedInInstancesOfClasses

        @NotNull
        public static @NotNull WKWebView appearanceWhenContainedInInstancesOfClasses​(@NotNull
                                                                                     @NotNull NSArray<?> containerTypes)
      • areAnimationsEnabled

        public static boolean areAnimationsEnabled()
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • beginAnimationsContext

        @Deprecated
        public static void beginAnimationsContext​(@Nullable
                                                  @Nullable java.lang.String animationID,
                                                  @Nullable
                                                  @Nullable org.moe.natj.general.ptr.VoidPtr context)
        Deprecated.
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • clearTextInputContextIdentifier

        public static void clearTextInputContextIdentifier​(@NotNull
                                                           @NotNull java.lang.String identifier)
      • commitAnimations

        @Deprecated
        public static void commitAnimations()
        Deprecated.
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • inheritedAnimationDuration

        public static double inheritedAnimationDuration()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • layerClass

        @NotNull
        public static @NotNull org.moe.natj.objc.Class layerClass()
      • new_objc

        public static WKWebView new_objc()
      • requiresConstraintBasedLayout

        public static boolean requiresConstraintBasedLayout()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setAnimationBeginsFromCurrentState

        @Deprecated
        public static void setAnimationBeginsFromCurrentState​(boolean fromCurrentState)
        Deprecated.
      • setAnimationCurve

        @Deprecated
        public static void setAnimationCurve​(long curve)
        Deprecated.
      • setAnimationDelay

        @Deprecated
        public static void setAnimationDelay​(double delay)
        Deprecated.
      • setAnimationDelegate

        @Deprecated
        public static void setAnimationDelegate​(@Nullable
                                                @Nullable java.lang.Object delegate)
        Deprecated.
      • setAnimationDidStopSelector

        @Deprecated
        public static void setAnimationDidStopSelector​(@Nullable
                                                       @Nullable org.moe.natj.objc.SEL selector)
        Deprecated.
      • setAnimationDuration_static

        @Deprecated
        public static void setAnimationDuration_static​(double duration)
        Deprecated.
      • setAnimationRepeatAutoreverses

        @Deprecated
        public static void setAnimationRepeatAutoreverses​(boolean repeatAutoreverses)
        Deprecated.
      • setAnimationRepeatCount_static

        @Deprecated
        public static void setAnimationRepeatCount_static​(float repeatCount)
        Deprecated.
      • setAnimationStartDate

        @Deprecated
        public static void setAnimationStartDate​(@NotNull
                                                 @NotNull NSDate startDate)
        Deprecated.
      • setAnimationTransitionForViewCache

        @Deprecated
        public static void setAnimationTransitionForViewCache​(long transition,
                                                              @NotNull
                                                              @NotNull UIView view,
                                                              boolean cache)
        Deprecated.
      • setAnimationWillStartSelector

        @Deprecated
        public static void setAnimationWillStartSelector​(@Nullable
                                                         @Nullable org.moe.natj.objc.SEL selector)
        Deprecated.
      • setAnimationsEnabled

        public static void setAnimationsEnabled​(boolean enabled)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • userInterfaceLayoutDirectionForSemanticContentAttribute

        public static long userInterfaceLayoutDirectionForSemanticContentAttribute​(long attribute)
      • userInterfaceLayoutDirectionForSemanticContentAttributeRelativeToLayoutDirection

        public static long userInterfaceLayoutDirectionForSemanticContentAttributeRelativeToLayoutDirection​(long semanticContentAttribute,
                                                                                                            long layoutDirection)
      • version_static

        public static long version_static()
      • UIDelegate

        @Nullable
        public @Nullable WKUIDelegate UIDelegate()
        The web view's user interface delegate.
      • URL

        @Nullable
        public @Nullable NSURL URL()
        The active URL. This is the URL that should be reflected in the user interface. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property.
      • allowsBackForwardNavigationGestures

        public boolean allowsBackForwardNavigationGestures()
        A Boolean value indicating whether horizontal swipe gestures will trigger back-forward list navigations. The default value is NO.
      • allowsLinkPreview

        public boolean allowsLinkPreview()
        A Boolean value indicating whether link preview is allowed for any links inside this WKWebView. The default value is YES on Mac and iOS. API-Since: 9.0
      • _appearance

        @NotNull
        public @NotNull WKWebView _appearance()
        Description copied from interface: UIAppearance
        To customize the appearance of all instances of a class, send the relevant appearance modification messages to the appearance proxy for the class. For example, to modify the bar tint color for all UINavigationBar instances: [[UINavigationBar appearance] setBarTintColor:myColor]; Note for iOS7: On iOS7 the tintColor property has moved to UIView, and now has special inherited behavior described in UIView.h. This inherited behavior can conflict with the appearance proxy, and therefore tintColor is now disallowed with the appearance proxy.
        Specified by:
        _appearance in interface UIAppearance
        Overrides:
        _appearance in class UIView
      • _appearanceWhenContainedIn

        @NotNull
        @Deprecated
        public @NotNull WKWebView _appearanceWhenContainedIn​(@Nullable
                                                             @Nullable UIAppearanceContainer ContainerClass,
                                                             java.lang.Object... varargs)
        Deprecated.
        Description copied from interface: UIAppearance
        To customize the appearances for instances of a class contained within an instance of a container class, or instances in a hierarchy, use +appearanceWhenContainedInInstancesOfClasses: for the appropriate appearance proxy. For example: [[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[UISplitViewController class]]] setBarTintColor:myColor]; [[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[UITabBarController class], [UISplitViewController class]]] setBarTintColor:myTabbedNavBarColor]; In any given view hierarchy the outermost appearance proxy wins. Specificity (depth of the chain) is the tie-breaker. In other words, the containment statement is treated as a partial ordering. Given a concrete ordering (actual subview hierarchy), we select the partial ordering that is the first unique match when reading the actual hierarchy from the window down. API-Since: 5.0 Deprecated-Since: 9.0
        Specified by:
        _appearanceWhenContainedIn in interface UIAppearance
        Overrides:
        _appearanceWhenContainedIn in class UIView
      • backForwardList

        @NotNull
        public @NotNull WKBackForwardList backForwardList()
        The web view's back-forward list.
      • canGoBack

        public boolean canGoBack()
        A Boolean value indicating whether there is a back item in the back-forward list that can be navigated to. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property.
      • canGoForward

        public boolean canGoForward()
        A Boolean value indicating whether there is a forward item in the back-forward list that can be navigated to. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property.
      • certificateChain

        @NotNull
        @Deprecated
        public @NotNull NSArray<?> certificateChain()
        Deprecated.
        API-Since: 9.0 Deprecated-Since: 10.0
      • configuration

        @NotNull
        public @NotNull WKWebViewConfiguration configuration()
        A copy of the configuration with which the web view was initialized.
      • customUserAgent

        @Nullable
        public @Nullable java.lang.String customUserAgent()
        The custom user agent string or nil if no custom user agent string has been set. API-Since: 9.0
      • estimatedProgress

        public double estimatedProgress()
        An estimate of what fraction of the current navigation has been completed. This value ranges from 0.0 to 1.0 based on the total number of bytes expected to be received, including the main document and all of its potential subresources. After a navigation completes, the value remains at 1.0 until a new navigation starts, at which point it is reset to 0.0. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property.
      • evaluateJavaScriptCompletionHandler

        public void evaluateJavaScriptCompletionHandler​(@NotNull
                                                        @NotNull java.lang.String javaScriptString,
                                                        @Nullable
                                                        @Nullable WKWebView.Block_evaluateJavaScriptCompletionHandler completionHandler)
        Evaluates the given JavaScript string. The completionHandler is passed the result of the script evaluation or an error. Calling this method is equivalent to calling `evaluateJavaScript:inFrame:inContentWorld:completionHandler:` with: - A `frame` value of `nil` to represent the main frame - A `contentWorld` value of `WKContentWorld.pageWorld`
        Parameters:
        javaScriptString - The JavaScript string to evaluate.
        completionHandler - A block to invoke when script evaluation completes or fails.
      • goBack

        @Nullable
        public @Nullable WKNavigation goBack()
        Navigates to the back item in the back-forward list.
        Returns:
        A new navigation to the requested item, or nil if there is no back item in the back-forward list.
      • goForward

        @Nullable
        public @Nullable WKNavigation goForward()
        Navigates to the forward item in the back-forward list.
        Returns:
        A new navigation to the requested item, or nil if there is no forward item in the back-forward list.
      • goToBackForwardListItem

        @Nullable
        public @Nullable WKNavigation goToBackForwardListItem​(@NotNull
                                                              @NotNull WKBackForwardListItem item)
        Navigates to an item from the back-forward list and sets it as the current item.
        Parameters:
        item - The item to which to navigate. Must be one of the items in the web view's back-forward list.
        Returns:
        A new navigation to the requested item, or nil if it is already the current item or is not part of the web view's back-forward list.
        See Also:
        backForwardList()
      • hasOnlySecureContent

        public boolean hasOnlySecureContent()
        A Boolean value indicating whether all resources on the page have been loaded over securely encrypted connections. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property.
      • initWithFrameConfiguration

        public WKWebView initWithFrameConfiguration​(CGRect frame,
                                                    @NotNull
                                                    @NotNull WKWebViewConfiguration configuration)
        Returns a web view initialized with a specified frame and configuration. This is a designated initializer. You can use [@link] -initWithFrame: @/link to initialize an instance with the default configuration. The initializer copies the specified configuration, so mutating the configuration after invoking the initializer has no effect on the web view.
        Parameters:
        frame - The frame for the new web view.
        configuration - The configuration for the new web view.
        Returns:
        An initialized web view, or nil if the object could not be initialized.
      • isLoading

        public boolean isLoading()
        A Boolean value indicating whether the view is currently loading content. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property.
      • loadDataMIMETypeCharacterEncodingNameBaseURL

        @Nullable
        public @Nullable WKNavigation loadDataMIMETypeCharacterEncodingNameBaseURL​(@NotNull
                                                                                   @NotNull NSData data,
                                                                                   @NotNull
                                                                                   @NotNull java.lang.String MIMEType,
                                                                                   @NotNull
                                                                                   @NotNull java.lang.String characterEncodingName,
                                                                                   @NotNull
                                                                                   @NotNull NSURL baseURL)
        Sets the webpage contents and base URL.
        Parameters:
        data - The data to use as the contents of the webpage.
        MIMEType - The MIME type of the data.
        characterEncodingName - The data's character encoding name.
        baseURL - A URL that is used to resolve relative URLs within the document.
        Returns:
        A new navigation. API-Since: 9.0
      • loadFileURLAllowingReadAccessToURL

        @Nullable
        public @Nullable WKNavigation loadFileURLAllowingReadAccessToURL​(@NotNull
                                                                         @NotNull NSURL URL,
                                                                         @NotNull
                                                                         @NotNull NSURL readAccessURL)
        Navigates to the requested file URL on the filesystem. If readAccessURL references a single file, only that file may be loaded by WebKit. If readAccessURL references a directory, files inside that file may be loaded by WebKit.
        Parameters:
        URL - The file URL to which to navigate.
        readAccessURL - The URL to allow read access to.
        Returns:
        A new navigation for the given file URL. API-Since: 9.0
      • loadHTMLStringBaseURL

        @Nullable
        public @Nullable WKNavigation loadHTMLStringBaseURL​(@NotNull
                                                            @NotNull java.lang.String string,
                                                            @Nullable
                                                            @Nullable NSURL baseURL)
        Sets the webpage contents and base URL.
        Parameters:
        string - The string to use as the contents of the webpage.
        baseURL - A URL that is used to resolve relative URLs within the document.
        Returns:
        A new navigation.
      • loadRequest

        @Nullable
        public @Nullable WKNavigation loadRequest​(@NotNull
                                                  @NotNull NSURLRequest request)
        Navigates to a requested URL.
        Parameters:
        request - The request specifying the URL to which to navigate.
        Returns:
        A new navigation for the given request.
      • navigationDelegate

        @Nullable
        public @Nullable WKNavigationDelegate navigationDelegate()
        The web view's navigation delegate.
      • reload

        @Nullable
        public @Nullable WKNavigation reload()
        Reloads the current page.
        Returns:
        A new navigation representing the reload.
      • reloadFromOrigin

        @Nullable
        public @Nullable WKNavigation reloadFromOrigin()
        Reloads the current page, performing end-to-end revalidation using cache-validating conditionals if possible.
        Returns:
        A new navigation representing the reload.
      • scrollView

        @NotNull
        public @NotNull UIScrollView scrollView()
        The scroll view associated with the web view.
      • serverTrust

        @Nullable
        public @Nullable SecTrustRef serverTrust()
        A SecTrustRef for the currently committed navigation. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property. API-Since: 10.0
      • setAllowsBackForwardNavigationGestures

        public void setAllowsBackForwardNavigationGestures​(boolean value)
        A Boolean value indicating whether horizontal swipe gestures will trigger back-forward list navigations. The default value is NO.
      • setAllowsLinkPreview

        public void setAllowsLinkPreview​(boolean value)
        A Boolean value indicating whether link preview is allowed for any links inside this WKWebView. The default value is YES on Mac and iOS. API-Since: 9.0
      • setCustomUserAgent

        public void setCustomUserAgent​(@Nullable
                                       @Nullable java.lang.String value)
        The custom user agent string or nil if no custom user agent string has been set. API-Since: 9.0
      • setNavigationDelegate_unsafe

        public void setNavigationDelegate_unsafe​(@Nullable
                                                 @Nullable WKNavigationDelegate value)
        The web view's navigation delegate.
      • setNavigationDelegate

        public void setNavigationDelegate​(@Nullable
                                          @Nullable WKNavigationDelegate value)
        The web view's navigation delegate.
      • setUIDelegate_unsafe

        public void setUIDelegate_unsafe​(@Nullable
                                         @Nullable WKUIDelegate value)
        The web view's user interface delegate.
      • setUIDelegate

        public void setUIDelegate​(@Nullable
                                  @Nullable WKUIDelegate value)
        The web view's user interface delegate.
      • stopLoading

        public void stopLoading()
        Stops loading all resources on the current page.
      • title

        @Nullable
        public @Nullable java.lang.String title()
        The page title. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property.
      • handlesURLScheme

        public static boolean handlesURLScheme​(@NotNull
                                               @NotNull java.lang.String urlScheme)
        Checks whether or not WKWebViews handle the given URL scheme by default.
        Parameters:
        scheme - The URL scheme to check. API-Since: 11.0
      • createPDFWithConfigurationCompletionHandler

        public void createPDFWithConfigurationCompletionHandler​(@Nullable
                                                                @Nullable WKPDFConfiguration pdfConfiguration,
                                                                @NotNull
                                                                @NotNull WKWebView.Block_createPDFWithConfigurationCompletionHandler completionHandler)
        Create a PDF document representation from the web page currently displayed in the WKWebView If the WKPDFConfiguration is nil, the method will create a PDF document representing the bounds of the currently displayed web page. The completionHandler is passed the resulting PDF document data or an error. The data can be used to create a PDFDocument object. If the data is written to a file the resulting file is a valid PDF document. API-Since: 14.0
        Parameters:
        pdfConfiguration - An object that specifies how the PDF capture is configured.
        completionHandler - A block to invoke when the pdf document data is ready.
      • createWebArchiveDataWithCompletionHandler

        public void createWebArchiveDataWithCompletionHandler​(@NotNull
                                                              @NotNull WKWebView.Block_createWebArchiveDataWithCompletionHandler completionHandler)
        Create WebKit web archive data representing the current web content of the WKWebView WebKit web archive data represents a snapshot of web content. It can be used to represent web content on a pasteboard, loaded into a WKWebView directly, and saved to a file for later use. The uniform type identifier kUTTypeWebArchive can be used get the related pasteboard type and MIME type. API-Since: 14.0
        Parameters:
        completionHandler - A block to invoke when the web archive data is ready.
      • evaluateJavaScriptInFrameInContentWorldCompletionHandler

        public void evaluateJavaScriptInFrameInContentWorldCompletionHandler​(@NotNull
                                                                             @NotNull java.lang.String javaScriptString,
                                                                             @Nullable
                                                                             @Nullable WKFrameInfo frame,
                                                                             @NotNull
                                                                             @NotNull WKContentWorld contentWorld,
                                                                             @Nullable
                                                                             @Nullable WKWebView.Block_evaluateJavaScriptInFrameInContentWorldCompletionHandler completionHandler)
        Evaluates the given JavaScript string. The completionHandler is passed the result of the script evaluation or an error. Passing nil is equivalent to targeting the main frame. If the frame argument no longer represents a valid frame by the time WebKit attempts to call the JavaScript function your completion handler will be called with a WKErrorJavaScriptInvalidFrameTarget error. This might happen for a number of reasons, including but not limited to: - The target frame has been removed from the DOM via JavaScript - A parent frame has navigated, destroying all of its previous child frames No matter which WKContentWorld you use to evaluate your JavaScript string, you can make changes to the underlying web content. (e.g. the Document and its DOM structure) Such changes will be visible to script executing in all WKContentWorlds. Evaluating your JavaScript string can leave behind other changes to global state visibile to JavaScript. (e.g. `window.myVariable = 1;`) Those changes will only be visibile to scripts executed in the same WKContentWorld. evaluateJavaScript: is a great way to set up global state for future JavaScript execution in a given world. (e.g. Importing libraries/utilities that future JavaScript execution will rely on) Once your global state is set up, consider using callAsyncJavaScript: for more flexible interaction with the JavaScript programming model. API-Since: 14.0
        Parameters:
        javaScriptString - The JavaScript string to evaluate.
        frame - A WKFrameInfo identifying the frame in which to evaluate the JavaScript string.
        contentWorld - The WKContentWorld in which to evaluate the JavaScript string.
        completionHandler - A block to invoke when script evaluation completes or fails.
      • findStringWithConfigurationCompletionHandler

        public void findStringWithConfigurationCompletionHandler​(@NotNull
                                                                 @NotNull java.lang.String string,
                                                                 @Nullable
                                                                 @Nullable WKFindConfiguration configuration,
                                                                 @NotNull
                                                                 @NotNull WKWebView.Block_findStringWithConfigurationCompletionHandler completionHandler)
        Searches the page contents for the given string. If the WKFindConfiguration is nil, all of the default WKFindConfiguration values will be used. A match found by the search is selected and the page is scrolled to reveal the selection. The completion handler is called after the search completes. API-Since: 14.0
        Parameters:
        string - The string to search for.
        configuration - A set of options configuring the search.
        completionHandler - A block to invoke when the search completes.
      • mediaType

        @Nullable
        public @Nullable java.lang.String mediaType()
        The media type for the WKWebView The value of mediaType will override the normal value of the CSS media property. Setting the value to nil will restore the normal value. The default value is nil. API-Since: 14.0
      • pageZoom

        public double pageZoom()
        The factor by which page content is scaled relative to the viewport. The default value is 1.0. Changing this value is equivalent to web content setting the CSS "zoom" property on all page content. API-Since: 14.0
      • setMediaType

        public void setMediaType​(@Nullable
                                 @Nullable java.lang.String value)
        The media type for the WKWebView The value of mediaType will override the normal value of the CSS media property. Setting the value to nil will restore the normal value. The default value is nil. API-Since: 14.0
      • setPageZoom

        public void setPageZoom​(double value)
        The factor by which page content is scaled relative to the viewport. The default value is 1.0. Changing this value is equivalent to web content setting the CSS "zoom" property on all page content. API-Since: 14.0
      • cameraCaptureState

        public long cameraCaptureState()
        The state of camera capture on a web page. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property. API-Since: 15.0
      • closeAllMediaPresentations

        @Deprecated
        public void closeAllMediaPresentations()
        Deprecated.
        API-Since: 14.5 Deprecated-Since: 15.0
      • closeAllMediaPresentationsWithCompletionHandler

        public void closeAllMediaPresentationsWithCompletionHandler​(@Nullable
                                                                    @Nullable WKWebView.Block_closeAllMediaPresentationsWithCompletionHandler completionHandler)
        Closes all out-of-window media presentations in a WKWebView. Includes picture-in-picture and fullscreen. API-Since: 15.0
      • interactionState

        @Nullable
        public @Nullable java.lang.Object interactionState()
        The interaction state for the WKWebView The interaction state (back-forward list, currently loaded page, scroll position, form data...) for the WKWebView, which can be retrieved and set on another WKWebView to restore state. API-Since: 15.0
      • loadFileRequestAllowingReadAccessToURL

        @NotNull
        public @NotNull WKNavigation loadFileRequestAllowingReadAccessToURL​(@NotNull
                                                                            @NotNull NSURLRequest request,
                                                                            @NotNull
                                                                            @NotNull NSURL readAccessURL)
        Navigates to the requested file URL on the filesystem. If readAccessURL references a single file, only that file may be loaded by WebKit. If readAccessURL references a directory, files inside that file may be loaded by WebKit.
        Parameters:
        request - The request specifying the file URL to which to navigate.
        readAccessURL - The URL to allow read access to.
        Returns:
        A new navigation for the given file URL. API-Since: 15.0
      • loadSimulatedRequestResponseResponseData

        @NotNull
        public @NotNull WKNavigation loadSimulatedRequestResponseResponseData​(@NotNull
                                                                              @NotNull NSURLRequest request,
                                                                              @NotNull
                                                                              @NotNull NSURLResponse response,
                                                                              @NotNull
                                                                              @NotNull NSData data)
        Sets the webpage contents from the passed data as if it was the response to the supplied request. The request is never actually sent to the supplied URL, though loads of resources defined in the NSData object would be performed.
        Parameters:
        request - The request specifying the base URL and other loading details to be used while interpreting the supplied data object.
        response - A response that is used to interpret the supplied data object.
        data - The data to use as the contents of the webpage.
        Returns:
        A new navigation. API-Since: 15.0
      • loadSimulatedRequestResponseHTMLString

        @NotNull
        public @NotNull WKNavigation loadSimulatedRequestResponseHTMLString​(@NotNull
                                                                            @NotNull NSURLRequest request,
                                                                            @NotNull
                                                                            @NotNull java.lang.String string)
        Sets the webpage contents from the passed HTML string as if it was the response to the supplied request. The request is never actually sent to the supplied URL, though loads of resources defined in the HTML string would be performed.
        Parameters:
        request - The request specifying the base URL and other loading details to be used while interpreting the supplied data object.
        string - The data to use as the contents of the webpage.
        Returns:
        A new navigation. API-Since: 15.0
      • loadSimulatedRequestWithResponseResponseData

        @NotNull
        @Deprecated
        public @NotNull WKNavigation loadSimulatedRequestWithResponseResponseData​(@NotNull
                                                                                  @NotNull NSURLRequest request,
                                                                                  @NotNull
                                                                                  @NotNull NSURLResponse response,
                                                                                  @NotNull
                                                                                  @NotNull NSData data)
        Deprecated.
        API-Since: 15.0 Deprecated-Since: 15.0
      • loadSimulatedRequestWithResponseHTMLString

        @NotNull
        @Deprecated
        public @NotNull WKNavigation loadSimulatedRequestWithResponseHTMLString​(@NotNull
                                                                                @NotNull NSURLRequest request,
                                                                                @NotNull
                                                                                @NotNull java.lang.String string)
        Deprecated.
        API-Since: 15.0 Deprecated-Since: 15.0
      • microphoneCaptureState

        public long microphoneCaptureState()
        The state of microphone capture on a web page. [@link] WKWebView @/link is key-value observing (KVO) compliant for this property. API-Since: 15.0
      • pauseAllMediaPlayback

        @Deprecated
        public void pauseAllMediaPlayback​(@Nullable
                                          @Nullable WKWebView.Block_pauseAllMediaPlayback completionHandler)
        Deprecated.
        API-Since: 14.5 Deprecated-Since: 15.0
      • pauseAllMediaPlaybackWithCompletionHandler

        public void pauseAllMediaPlaybackWithCompletionHandler​(@Nullable
                                                               @Nullable WKWebView.Block_pauseAllMediaPlaybackWithCompletionHandler completionHandler)
        Pauses media playback in WKWebView. Pauses media playback. Media in the page can be restarted by calling play() on a media element or resume() on an AudioContext in JavaScript. A user can also use media controls to play media content after it has been paused. API-Since: 15.0
      • requestMediaPlaybackState

        @Deprecated
        public void requestMediaPlaybackState​(@NotNull
                                              @NotNull WKWebView.Block_requestMediaPlaybackState completionHandler)
        Deprecated.
        API-Since: 14.5 Deprecated-Since: 15.0
      • requestMediaPlaybackStateWithCompletionHandler

        public void requestMediaPlaybackStateWithCompletionHandler​(@NotNull
                                                                   @NotNull WKWebView.Block_requestMediaPlaybackStateWithCompletionHandler completionHandler)
        Get the current media playback state of a WKWebView. If media playback exists, WKMediaPlaybackState will be one of three values: WKMediaPlaybackPaused, WKMediaPlaybackSuspended, or WKMediaPlaybackPlaying. If no media playback exists in the current WKWebView, WKMediaPlaybackState will equal WKMediaPlaybackStateNone. API-Since: 15.0
        Parameters:
        completionHandler - A block to invoke with the return value of the function call.
      • resumeAllMediaPlayback

        @Deprecated
        public void resumeAllMediaPlayback​(@Nullable
                                           @Nullable WKWebView.Block_resumeAllMediaPlayback completionHandler)
        Deprecated.
        API-Since: 14.5 Deprecated-Since: 15.0
      • resumeDownloadFromResumeDataCompletionHandler

        public void resumeDownloadFromResumeDataCompletionHandler​(@NotNull
                                                                  @NotNull NSData resumeData,
                                                                  @NotNull
                                                                  @NotNull WKWebView.Block_resumeDownloadFromResumeDataCompletionHandler completionHandler)
        Resumes a download that failed or was canceled. The download needs its delegate to be set in the completionHandler to receive updates about its progress. API-Since: 14.5
        Parameters:
        resumeData - Data from a WKDownloadDelegate's didFailWithError or a WKDownload's cancel completionHandler.
        completionHandler - A block called when the download has resumed.
      • setAllMediaPlaybackSuspendedCompletionHandler

        public void setAllMediaPlaybackSuspendedCompletionHandler​(boolean suspended,
                                                                  @Nullable
                                                                  @Nullable WKWebView.Block_setAllMediaPlaybackSuspendedCompletionHandler completionHandler)
        Suspends or resumes all media playback in WKWebView. If suspended is true, this pauses media playback and blocks all attempts by the page or the user to resume until setAllMediaPlaybackSuspended is called again with suspended set to false. Media playback should always be suspended and resumed in pairs. API-Since: 15.0
        Parameters:
        suspended - Whether media playback should be suspended or resumed.
      • setCameraCaptureStateCompletionHandler

        public void setCameraCaptureStateCompletionHandler​(long state,
                                                           @Nullable
                                                           @Nullable WKWebView.Block_setCameraCaptureStateCompletionHandler completionHandler)
        Set camera capture state of a WKWebView. If value is WKMediaCaptureStateNone, this will stop any camera capture. If value is WKMediaCaptureStateMuted, any active camera capture will become muted. If value is WKMediaCaptureStateActive, any muted camera capture will become active. API-Since: 15.0
        Parameters:
        state - State to apply for capture.
        completionHandler - A block to invoke after the camera state has been changed.
      • setInteractionState

        public void setInteractionState​(@Nullable
                                        @Nullable java.lang.Object value)
        The interaction state for the WKWebView The interaction state (back-forward list, currently loaded page, scroll position, form data...) for the WKWebView, which can be retrieved and set on another WKWebView to restore state. API-Since: 15.0
      • setMicrophoneCaptureStateCompletionHandler

        public void setMicrophoneCaptureStateCompletionHandler​(long state,
                                                               @Nullable
                                                               @Nullable WKWebView.Block_setMicrophoneCaptureStateCompletionHandler completionHandler)
        Set microphone capture state of a WKWebView. If value is WKMediaCaptureStateNone, this will stop any microphone capture. If value is WKMediaCaptureStateMuted, any active microphone capture will become muted. If value is WKMediaCaptureStateActive, any muted microphone capture will become active. API-Since: 15.0
        Parameters:
        state - state to apply for capture.
        completionHandler - A block to invoke after the microphone state has been changed.
      • setUnderPageBackgroundColor

        public void setUnderPageBackgroundColor​(UIColor value)
        API-Since: 15.0
      • startDownloadUsingRequestCompletionHandler

        public void startDownloadUsingRequestCompletionHandler​(@NotNull
                                                               @NotNull NSURLRequest request,
                                                               @NotNull
                                                               @NotNull WKWebView.Block_startDownloadUsingRequestCompletionHandler completionHandler)
        Begins a download in the context of the currently displayed webpage as if the WKNavigationDelegate turned a navigation into a download instead The download needs its delegate to be set in the completionHandler to receive updates about its progress. API-Since: 14.5
        Parameters:
        request - The request specifying the URL to download.
        completionHandler - A block called when the download has started.
      • suspendAllMediaPlayback

        @Deprecated
        public void suspendAllMediaPlayback​(@Nullable
                                            @Nullable WKWebView.Block_suspendAllMediaPlayback completionHandler)
        Deprecated.
        API-Since: 14.5 Deprecated-Since: 15.0
      • themeColor

        @Nullable
        public @Nullable UIColor themeColor()
        API-Since: 15.0
      • underPageBackgroundColor

        public UIColor underPageBackgroundColor()
        API-Since: 15.0
      • findInteraction

        @Nullable
        public @Nullable UIFindInteraction findInteraction()
        If @link findInteractionEnabled @/link is set to true, returns this web view's built-in find interaction. Otherwise, nil. API-Since: 16.0
      • fullscreenState

        public long fullscreenState()
        A WKWebView's fullscreen state. [@link] WKWebView @link is key-value observing (KVO) compliant for this property. When an element in the WKWebView enters fullscreen, WebKit will replace the WKWebView in the application view hierarchy with a "placeholder" view, and move the WKWebView into a fullscreen window. When the element exits fullscreen later, the WKWebView will be moved back into the application view hierarchy. An application may need to adjust/restore its native UI components when the fullscreen state changes. The application should observe the fullscreenState property of WKWebView in order to receive notifications regarding the fullscreen state change. API-Since: 16.0
      • isFindInteractionEnabled

        public boolean isFindInteractionEnabled()
        Enables the web view's built-in find interaction. API-Since: 16.0
      • maximumViewportInset

        public UIEdgeInsets maximumViewportInset()
        API-Since: 15.5
      • minimumViewportInset

        public UIEdgeInsets minimumViewportInset()
        API-Since: 15.5
      • setFindInteractionEnabled

        public void setFindInteractionEnabled​(boolean value)
        Enables the web view's built-in find interaction. API-Since: 16.0
      • setMinimumViewportInsetMaximumViewportInset

        public void setMinimumViewportInsetMaximumViewportInset​(UIEdgeInsets minimumViewportInset,
                                                                UIEdgeInsets maximumViewportInset)
        API-Since: 15.5
      • isInspectable

        public boolean isInspectable()
        Controls whether this @link WKWebView @/link is inspectable in Web Inspector. The default value is NO. API-Since: 16.4
      • setInspectable

        public void setInspectable​(boolean value)
        Controls whether this @link WKWebView @/link is inspectable in Web Inspector. The default value is NO. API-Since: 16.4
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.