Mac Developer Library

Developer

WebKit Framework Reference WebPolicyDecisionListener Protocol Reference

Options
Deployment Target:

On This Page
Language:

WebPolicyDecisionListener

This protocol enables WebView policy delegates to communicate with listener objects. A listener object conforming to this protocol is passed as one of the arguments to web view policy delegate methods. More...

Inheritance


Not Applicable

Import Statement


import WebKit @import WebKit;

Availability


Available in OS X v10.2 with Safari 1.0 and later.
Available in OS X v10.2.7 and later.
  • Tells the listener to download the resource instead of displaying it.

    Declaration

    Swift

    func download()

    Objective-C

    - (void)download

    Discussion

    This method converts a location change that may be in progress to a download operation without having to stop and restart the download. You might invoke this method based on the content’s MIME type.

    Import Statement

    import WebKit

    Availability

    Available in OS X v10.2 with Safari 1.0 and later.

    Available in OS X v10.2.7 and later.

  • Tells the listener to ignore the resource.

    Declaration

    Swift

    func ignore()

    Objective-C

    - (void)ignore

    Discussion

    You might invoke this method to handle the resource request yourself. For example, you might want to open a new window, open a window behind the current window, open a URL in an external application, or show a file URL location in the Finder.

    Import Statement

    import WebKit

    Availability

    Available in OS X v10.2 with Safari 1.0 and later.

    Available in OS X v10.2.7 and later.

  • Tells the listener to use the resource.

    Declaration

    Swift

    func use()

    Objective-C

    - (void)use

    Discussion

    If there are pending policy decisions, the next policy delegate method has the opportunity to decide what to do with the resource. This will be either the next navigation policy delegate (if there is a redirect), or the content policy delegate. If there are no pending policy decisions, the resource will be displayed if possible. If there is no document view available to display the resource, then the webView:unableToImplementPolicyWithError:frame: message will be sent to the web view policy delegate with an appropriate error. Invoking this method creates any new windows needed to handle the resource.

    Import Statement

    import WebKit

    Availability

    Available in OS X v10.2 with Safari 1.0 and later.

    Available in OS X v10.2.7 and later.