WebView.AllowedScriptNotifyUris 属性

定义

注意

为Windows 8.1编译的应用不支持 AllowedScriptNotifyUris。 请改为更新应用清单的 ApplicationContentUriRules 部分。 有关详细信息,请参阅“备注”部分。

获取或设置允许向此 WebView 触发 ScriptNotify 事件的 URI 的安全列表。

public:
 property IVector<Uri ^> ^ AllowedScriptNotifyUris { IVector<Uri ^> ^ get(); void set(IVector<Uri ^> ^ value); };
/// [get: Windows.Foundation.Metadata.Deprecated("AllowedScriptNotifyUris is unavailable for releases beginning with Windows 8.1. Instead, list URIs under ApplicationContentUriRules in the package manifest. For more info, see the AllowedScriptNotifyUris documentation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [set: Windows.Foundation.Metadata.Deprecated("AllowedScriptNotifyUris is unavailable for releases beginning with Windows 8.1. Instead, list URIs under ApplicationContentUriRules in the package manifest. For more info, see the AllowedScriptNotifyUris documentation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
IVector<Uri> AllowedScriptNotifyUris();

void AllowedScriptNotifyUris(IVector<Uri> value);
/// [get: Windows.Foundation.Metadata.Deprecated("AllowedScriptNotifyUris is unavailable for releases beginning with Windows 8.1. Instead, list URIs under ApplicationContentUriRules in the package manifest. For more info, see the AllowedScriptNotifyUris documentation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
/// [set: Windows.Foundation.Metadata.Deprecated("AllowedScriptNotifyUris is unavailable for releases beginning with Windows 8.1. Instead, list URIs under ApplicationContentUriRules in the package manifest. For more info, see the AllowedScriptNotifyUris documentation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
IVector<Uri> AllowedScriptNotifyUris();

void AllowedScriptNotifyUris(IVector<Uri> value);
public IList<System.Uri> AllowedScriptNotifyUris { [Windows.Foundation.Metadata.Deprecated("AllowedScriptNotifyUris is unavailable for releases beginning with Windows 8.1. Instead, list URIs under ApplicationContentUriRules in the package manifest. For more info, see the AllowedScriptNotifyUris documentation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] get; [Windows.Foundation.Metadata.Deprecated("AllowedScriptNotifyUris is unavailable for releases beginning with Windows 8.1. Instead, list URIs under ApplicationContentUriRules in the package manifest. For more info, see the AllowedScriptNotifyUris documentation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] set; }
public IList<System.Uri> AllowedScriptNotifyUris { [Windows.Foundation.Metadata.Deprecated("AllowedScriptNotifyUris is unavailable for releases beginning with Windows 8.1. Instead, list URIs under ApplicationContentUriRules in the package manifest. For more info, see the AllowedScriptNotifyUris documentation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] get; [Windows.Foundation.Metadata.Deprecated("AllowedScriptNotifyUris is unavailable for releases beginning with Windows 8.1. Instead, list URIs under ApplicationContentUriRules in the package manifest. For more info, see the AllowedScriptNotifyUris documentation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] set; }
var iVector = webView.allowedScriptNotifyUris;
webView.allowedScriptNotifyUris = iVector;
Public Property AllowedScriptNotifyUris As IList(Of Uri)

属性值

允许触发 ScriptNotify 事件的 URI 的安全列表。

属性

注解

Windows 8.1

为Windows 8.1编译的应用不支持 AllowedScriptNotifyUris。 若要启用外部网页在调用 window.external.notify 时触发 ScriptNotify 事件,必须在应用清单的 ApplicationContentUriRules 节中包含页面的 URI。 (可以在 Visual Studio 中通过 Package.appxmanifest designer 的“内容 URI”选项卡执行此操作。) 此列表中的 URI 必须使用 HTTPS,并且可能包含子域通配符 (例如 https://.microsoft.com) ,但它们不能包含域通配符 (例如 https://.com 和 https://) 。 该部件清单要求不适用于源自应用包的内容、使用 ms-local-stream:// URI 的内容或使用 NavigateToString 加载的内容。

Windows 8

这些备注仅适用于为 Windows 8 编译的应用,即使在 Windows 8.1 上运行也是如此。

若要使外部网页在调用 window.external.notify 时触发 ScriptNotify 事件,必须在 AllowedScriptNotifyUris 属性返回的列表中包括页面的 URI。 将此属性设置为 AnyScriptNotifyUri 以指示任何页面都可以为此 WebView 控件触发 ScriptNotify 事件。 此要求不适用于使用 NavigateToString 方法加载的内容。

适用于