共用方式為


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 方法載入的內容。

適用於