Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

HtmlUrlPolicy

OfficeIMO.Html

Namespace
OfficeIMO.Html
Assembly
OfficeIMO.Html
Source revision
be6c300e4ab1 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 29 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() #

Creates a copy of the current policy instance.

public static HtmlUrlPolicy CreateEmbeddedResourceProfile() #

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

public static HtmlUrlPolicy CreateHyperlinkProfile() #

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

public static HtmlUrlPolicy CreateOfficeIMOProfile() #

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

public static HtmlUrlPolicy CreateWebOnlyProfile() #

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

public static HtmlUrlPolicy CreateWebResourceProfile() #

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

Properties

public bool DisallowScriptUrls { get; set; } #

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

public bool DisallowFileUrls { get; set; } #

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

public bool AllowMailtoUrls { get; set; } #

When false, mailto: URLs are rejected.

public bool AllowDataUrls { get; set; } #

When false, data: URLs are rejected.

public bool AllowProtocolRelativeUrls { get; set; } #

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

public bool 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.