MBS Plugin Documentation

Search:

Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchie

New in Version 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 9.0

The list of the   themes,   classes,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

class WebPolicyDelegateMBS
class, HTMLViewer, MBS Cocoa Plugin (HTMLViewerDelegate), class WebPolicyDelegateMBS, Console safe, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: A class to decide policies for webkit.
Notes:
While loading a URL, WebKit asks the WebPolicyDelegate for policies that determine the action of what to do with the URL or the data that the URL represents. Typically, the policy handler methods are called in this order:

decidePolicyForNewWindowAction (at most once)
decidePolicyForNavigationAction (zero or more times)
decidePolicyForMIMEType:request (zero or more times)<BR>

New window policy is always checked. Navigation policy is checked for the initial load and every redirect unless blocked by an earlier policy. Content policy is checked once the content type is known, unless an earlier policy prevented it.

In rare cases, content policy might be checked more than once. This occurs when loading a "multipart/x-mixed-replace" document, also known as "server push". In this case, multiple documents come in one navigation, with each replacing the last. In this case, conent policy will be checked for each one.

All methods in this class will catch exceptions from Cocoa and raise a NSExceptionMBS instead. Using the message, name and reason properties you can see what was the reason for this exception. Please report if you find a method which does not handle exceptions correct.
WebPolicyDelegateMBS.Close
event, HTMLViewer, MBS Cocoa Plugin (HTMLViewerDelegate), class WebPolicyDelegateMBS, Plugin version: 7.5, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The close event.
Notes: Called when the delegate is destroyed.
WebPolicyDelegateMBS.decidePolicyForMIMEType(type as string,request as NSURLRequestMBS, frame as WebFrameMBS, decisionListener as WebPolicyDecisionListenerMBS) as boolean
event, HTMLViewer, MBS Cocoa Plugin (HTMLViewerDelegate), class WebPolicyDelegateMBS, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Returns the policy for content which has been partially loaded.
Notes:
Sent after didStartProvisionalLoadForFrame is sent on the WebFrameLoadDelegate.

type: MIME type for the resource.
request: A NSURLRequest for the partially loaded content.
frame: The frame which is loading the URL.
decisionListener: The object to call when the decision is made

Return true to avoid the default delegate to handle this request.
WebPolicyDelegateMBS.decidePolicyForNavigationAction(request as NSURLRequestMBS, frame as WebFrameMBS, decisionListener as WebPolicyDecisionListenerMBS, NavigationType as integer, ModifierFlags as integer, OriginalURL as string) as boolean
event, HTMLViewer, MBS Cocoa Plugin (HTMLViewerDelegate), class WebPolicyDelegateMBS, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: This method is called to decide what to do with a proposed navigation.
Notes:
request: The request for the proposed navigation
frame: The WebFrame in which the navigation is happening
decisionListener: The object to call when the decision is made

This method will be called before loading starts, and on every redirect.

Values for NavigationType:
const WebNavigationTypeLinkClicked= 0A link with an href was clicked.
const WebNavigationTypeFormSubmitted= 1A form was submitted.
const WebNavigationTypeBackForward= 2The user chose back or forward.
const WebNavigationTypeReload= 3The User hit the reload button.
const WebNavigationTypeFormResubmitted= 4A form was resubmitted (by virtue of doing back, forward or reload).
const WebNavigationTypeOther= 5Navigation is taking place for some other reason.

Return true to avoid the default delegate to handle this request.
WebPolicyDelegateMBS.decidePolicyForNewWindowAction(request as NSURLRequestMBS, framename as string, decisionListener as WebPolicyDecisionListenerMBS, NavigationType as integer, ModifierFlags as integer, OriginalURL as string) as boolean
event, HTMLViewer, MBS Cocoa Plugin (HTMLViewerDelegate), class WebPolicyDelegateMBS, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: This method is called to decide what to do with an targetted nagivation that would open a new window.
Notes:
request The request for the proposed navigation
frame The frame in which the navigation is taking place
decisionListener The object to call when the decision is made

This method is provided so that modified clicks on a targetted link which opens a new frame can prevent the new window from being opened if they decide to do something else, like download or present the new frame in a specialized way.

If this method picks a policy of Use, the new window will be opened, and decidePolicyForNavigationAction will be called with a WebNavigationType of WebNavigationTypeOther in its action. This is to avoid possible confusion about the modifiers.

Values for NavigationType:
const WebNavigationTypeLinkClicked= 0A link with an href was clicked.
const WebNavigationTypeFormSubmitted= 1A form was submitted.
const WebNavigationTypeBackForward= 2The user chose back or forward.
const WebNavigationTypeReload= 3The User hit the reload button.
const WebNavigationTypeFormResubmitted= 4A form was resubmitted (by virtue of doing back, forward or reload).
const WebNavigationTypeOther= 5Navigation is taking place for some other reason.

Return true to avoid the default delegate to handle this request.
WebPolicyDelegateMBS.Open
event, HTMLViewer, MBS Cocoa Plugin (HTMLViewerDelegate), class WebPolicyDelegateMBS, Plugin version: 7.5, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The open event.
Notes:
Called just after the delegate has been installed in a htmlviewer control.
This allows you to initialize your stuff before the first event is called.
WebPolicyDelegateMBS.unableToImplementPolicyWithError(errorString as string, frame as WebFrameMBS) as boolean
event, HTMLViewer, MBS Cocoa Plugin (HTMLViewerDelegate), class WebPolicyDelegateMBS, Plugin version: 7.2, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Called when a WebPolicy could not be implemented.
Notes:
It is up to the client to display appropriate feedback.

errorString: The error that caused the policy to not be implemented.
frame: The frame in which the policy could not be implemented.

Return true to avoid the default delegate to handle this request.

The items on this page are in the following plugins: MBS Cocoa Plugin.