Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

HtmlUrlPolicy

Namespace OfficeIMO.Html
Assembly OfficeIMO.Html
Source revision 804a7612eee4 with working tree changes
Modifiers sealed

Shared URL policy used by OfficeIMO HTML ingestion adapters before links or resource references are materialized.

Inheritance

  • Object
  • HtmlUrlPolicy

Usage

Explore 31 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Constructors

public HtmlUrlPolicy() #

Methods

public HtmlUrlPolicy Clone() #
Returns: HtmlUrlPolicy

Creates a copy of the current policy instance.

public static HtmlUrlPolicy CreateEmbeddedResourceProfile() #
Returns: HtmlUrlPolicy

Creates an offline resource policy that accepts bounded embedded data while rejecting file and network schemes.

public static HtmlUrlPolicy CreateHyperlinkProfile() #
Returns: HtmlUrlPolicy

Creates a hyperlink policy that rejects script, file, and data URLs while allowing common web, mail, and telephone links.

public static HtmlUrlPolicy CreateOfficeIMOProfile() #
Returns: HtmlUrlPolicy

Creates the default OfficeIMO URL policy for trusted compatibility-oriented HTML ingestion.

public static HtmlUrlPolicy CreateWebOnlyProfile() #
Returns: HtmlUrlPolicy

Creates a restrictive web-only policy that accepts only HTTP, HTTPS, mail, and telephone links.

public static HtmlUrlPolicy CreateWebResourceProfile() #
Returns: HtmlUrlPolicy

Creates a resource policy that accepts only HTTP and HTTPS network references. Mail, telephone, script, file, and data URLs are rejected.

Properties

public Boolean DisallowScriptUrls { get; set; } #

When true, script-like URL schemes such as javascript: and vbscript: are rejected.

public Boolean DisallowFileUrls { get; set; } #

When true, file: URLs and Windows drive-path URL targets are rejected.

public Boolean AllowMailtoUrls { get; set; } #

When false, mailto: URLs are rejected.

public Boolean AllowDataUrls { get; set; } #

When false, data: URLs are rejected.

public Boolean AllowProtocolRelativeUrls { get; set; } #

When false, protocol-relative URLs such as //example.com/image.png are rejected unless callers resolve them first.

public Boolean RestrictUrlSchemes { get; set; } #

When true, absolute URLs must use a scheme listed in HtmlUrlPolicy.AllowedUrlSchemes. Relative URLs and fragments are still allowed by the evaluator.

public Func<String, String?>? ResolvedUrlTransform { get; set; } #

Optional trusted transform applied after a URL passes policy checks and base-URI resolution. Return null or an empty string to reject the resolved URL. Transformed values are checked against this policy again before use.

public HashSet<String> AllowedUrlSchemes { get; } #

URL schemes allowed when HtmlUrlPolicy.RestrictUrlSchemes is enabled.