uap:Rule (Windows 10)

Specifies which pages in the web context have access to the system's geolocation devices (if the app has permission to access this capability) and access to the clipboard.

Element hierarchy

<Package>
<Applications>
<Application>
<uap:ApplicationContentUriRules>
<uap:Rule>

Syntax

<Rule Type                  = "include" | "exclude"
      Match                 = A string between 1 and 2084 characters in length.
      WindowsRuntimeAccess? = "allowForWebOnly" | "all" | "none" 
      uap5:ServiceWorker?   = Boolean />

Key

? optional (zero or one)

Attributes and Elements

Attributes

Attribute Description Data type Required Default value
Match

The IRI to use in the rule. See RFC 3987 - Internationalized Resource Identifiers (IRIs) for details. It is unique per application in the package and is case sensitive. For example, values of Match can be: https://www.microsoft.com/, or *.pdf

A string between 1 and 2084 characters in length. Yes
Type

A string that specifies whether the rule is an inclusion or exclusion rule.

This attribute can have one of the following values:

  • include
  • exclude
Yes
WindowsRuntimeAccess

Declares UWP (Windows Runtime) access from remote sites. This attribute gives control to a developer to specify the set of URIs that can access UWP APIs from their website.

The value "allowForWebOnly" indicates that only UWP APIs created by the developer and included inside the app package will be exposed. Note that the UWP Windows Runtime class that is intended to be exposed to JavaScript must be decorated with the [AllowForWeb] attribute where it is declared.

The value "all" indicates all allowed UWP APIs will be available.

The value "none" (the default value) explicitly states that no UWP APIs will be exposed.

This attribute is not allowed if Type is set to "exclude".

This attribute can have one of the following values:

  • allowForWebOnly
  • all
  • none
No
uap5:ServiceWorker

This represents the registration of a service worker from a web page (a Progressive Web App) to run as a UWP app. If true, it will be determined whether a URL the app navigates to has the permission required to register the app as a service worker.

Boolean

No

Child Elements

None.

Parent Elements

Parent Element Description
uap:ApplicationContentUriRules

Specifies which pages in the web context have access to the system's geolocation devices (if the app has permission to access this capability) and access to the clipboard.

Remarks

If more than one rule is defined, then the order of the rules is important.

To define the Match attribute with an IRI for a web resource, you can specify only secure "https:" sites - unsecure "http:" sites aren't allowed. If you specify a "http:" site, you get a schema semantic check validation error.

For any values that have a scheme in Windows 8.1 (version 6.3.0), the manifest only permits secure "https:" scheme. The manifest fails any other scheme. This rule doesn't apply on Windows 8 apps for backward compatibility.

Requirements

Namespace

http://schemas.microsoft.com/appx/manifest/uap/windows10