From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/document/documenturiobject/index.html | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 files/ja/web/api/document/documenturiobject/index.html (limited to 'files/ja/web/api/document/documenturiobject') diff --git a/files/ja/web/api/document/documenturiobject/index.html b/files/ja/web/api/document/documenturiobject/index.html new file mode 100644 index 0000000000..fa5602c622 --- /dev/null +++ b/files/ja/web/api/document/documenturiobject/index.html @@ -0,0 +1,46 @@ +--- +title: Document.documentURIObject +slug: Web/API/Document/documentURIObject +tags: + - API + - DOM + - Non-standard + - Reference + - プロパティ + - 標準外 +translation_of: Web/API/Document/documentURIObject +--- +
{{ApiRef("DOM")}}{{Non-standard_header}}
+ +

Document.documentURIObject プロパティは読み取り専用で、 document の URI を表す {{Interface("nsIURI")}} オブジェクトを返します。

+ +

このプロパティは、拡張機能のコードなどの (UniversalXPConnect) 特権を持つスクリプトでのみ機能します。ウェブコンテンツではこのプロパティは特別な意味を持たず、他のカスタムプロパティと同様に扱うことしかできません。

+ +

特権コードでは、(XPCNativeWrapperwrappedJSObject などの) ラップされていないコンテンツオブジェクトに対してこのプロパティを取得または設定しないように注意しなければなりません。詳しくは {{Bug(324464)}} のコメントを参照して下さい。

+ +

構文

+ +
var uri = document.documentURIObject;
+
+ +

+ +
// Firefox の現在のタブの URI スキームが "http" かどうか調べる
+// このコードは browser.xul のコンテキストで実行されるものとする
+var uriObj = content.document.documentURIObject;
+var uriPort = uriObj.port;
+
+if (uriObj.schemeIs('http')) {
+  ...
+}
+
+ +

仕様書

+ +

どの仕様にも属しません。

+ +

ブラウザーの対応

+ + + +

{{Compat("api.Document.documentURIObject")}}

-- cgit v1.2.3-54-g00ecf