Platforms to show: All Mac Windows Linux Cross-Platform

WebPolicyDelegateMBS class   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
class HTMLViewer Mac MBS MacControls Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: A class to decide policies for webkit.
This item is deprecated and should no longer be used.
Notes:
This classs is not available in Xojo 2020r1 or newer.

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.

Please use one delegate class per HTMLViewer (or WebViewMBS) and make sure they live about the same time. Our class keeps a reference on the WebView, so we can remove our delegate when the delegate is destroyed.

This class has no sub classes.

Some useful global functions for this class:


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


WebPolicyDecisionListenerMBS   -   WebPreferencesMBS

Feedback: Report problem or ask question.

The biggest plugin in space...