/
179.txt
105 lines (78 loc) · 4.99 KB
/
179.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
* 仕様書
[REFS[
- [17] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-04-25 04:40:19 +09:00]] 版) <https://html.spec.whatwg.org/#dom-document-domain>
-- [20] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-04-25 04:40:19 +09:00]] 版) <https://html.spec.whatwg.org/#the-document's-domain>
]REFS]
* 意味
[22] [CODE(JS)@en[[[document.domain]]]] は、同じ[[ドメイン]]の異なる[[ホスト]]のページが互いの
[[DOM]] のアクセスできるようにするものです [SRC[>>17]]。
[23] [CODE(JS)@en[[[document.domain]]]] を使って[[同一起源ポリシー]]の制約を緩和すると、
[[三項組]]のうち[[ポート]]部分は無視されることになりますから、注意が必要です。
特に同じ[[IPアドレス]]で複数の(異なる[[著者]]の)異なる[[ポート]]の
[[HTTPサーバー]]が動作しているような場合には、[CODE(JS)@en[[[document.domain]]]]
によって通常ならアクセスできない[[起源]]のページから [[DOM]]
にアクセスできてしまうことがあります。 [SRC[>>17]]
* 文書のドメイン
[21] 文書の[DFN[[RUBYB[ドメイン]@en[domain]]]]は、
[[文書の起源]]の[[ホスト]]の部分です。[[文書の起源]]が[[三項組]]でないなら、
[[文書のドメイン]]はありません。 [SRC[>>20]]
* 取得器
[18] [CODE(JS)@en[[[document.domain]]]] [[IDL属性]]は、 [CODE(DOMi)@en[[[DOMString]]]]
を返します [SRC[>>17]]。
* 設定器
[19] [CODE(JS)@en[[[document.domain]]]] [[IDL属性]]には、
[CODE(DOMi)@en[[[DOMString]]]] を設定できます [SRC[>>17]]。
* 歴史
[REFS[
- [5] [CITE[Origin feedback]] ([[Ian Hickson <ian@...>]] 著, [TIME[2008-04-29 03:08:06 +09:00]] 版) <http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/13912>
- [2] [CITE['''['''whatwg''']''' Communicating between different-origin frames]]
([TIME[2010-08-11 09:23:43 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-August/027839.html>
- [3] [CITE[Document Structure – SVG 1.1 (Second Edition)]]
( ([TIME[2011-08-10 12:35:27 +09:00]] 版))
<http://www.w3.org/TR/2011/REC-SVG11-20110816/struct.html#__svg__SVGDocument__domain>
- [4] [CITE@en[Web Applications 1.0 r6789 Go back to ignoring document.domain changes for the purposes of canvas tainting.]]
( ([TIME[2011-10-31 03:11:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6788&to=6789>
]REFS]
[1]
[CITE[Abe Fettig’s Weblog » How to make XmlHttpRequest calls to another server in your domain]] <http://fettig.net/weblog/2005/11/28/how-to-make-xmlhttprequest-connections-to-another-server-in-your-domain/>
[6] [CITE@en[IE8 Security Part VI: Beta 2 Update - IEBlog - Site Home - MSDN Blogs]]
( ([TIME[2012-11-18 01:18:13 +09:00]] 版))
<http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx>
[7] [CITE[Document Object Model for MathML]]
( ([TIME[2001-02-20 21:36:10 +09:00]] 版))
<http://www.w3.org/TR/2001/REC-MathML2-20010221/appendixd.html#dom_Document>
[8] [CITE[Document Object Model for MathML]]
( ([TIME[2002-05-23 15:35:03 +09:00]] 版))
<http://www.w3.org/Math/DOM/mathml2/appendixd.html#dom_Document>
[9] [CITE[IRC logs: freenode / #whatwg / 20130110]]
( ([TIME[2013-01-13 18:26:04 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130110>
[10] [CITE@en[Web Applications 1.0 r8275 Make sandboxed iframes block document.domain setting]]
( ([TIME[2013-11-14 04:32:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8274&to=8275>
[11] [CITE[IRC logs: freenode / #whatwg / 20140311]]
( ([TIME[2014-03-12 21:02:53 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140311#l-447>
[12] [CITE@en[Web Applications 1.0 r8262 Move the spec from a stack of incumbent scripts to a stack of script settings object. This should in theory have no concrete effects (though I may have changed some of the origin used for Web Workers started from document.domain-affected scripts that were called from other scripts with different original origins).]]
( ([TIME[2013-11-09 08:21:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8261&to=8262>
[13] [CITE[IRC logs: freenode / #whatwg / 20141018]]
( ([TIME[2014-10-19 02:05:35 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20141018>
[14] [CITE@en[340494 – access document.domain at about:plugins produces NS_ERROR_FAILURE. No error at about:config]]
( ([TIME[2014-12-10 21:37:26 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=340494>
[FIG(quote)[
[FIGCAPTION[
[15] [CITE@ja[ブラウザ JavaScript]]
([TIME[2015-03-14 20:56:03 +09:00]] 版)
<http://www.opera.com/docs/browserjs/>
]FIGCAPTION]
>
> 最後の TLD には document.domain はセットできない
]FIG]
[16] [CITE[Part2 - browsersec - Browser Security Handbook, part 2 - Browser Security Handbook - Google Project Hosting]]
([TIME[2015-03-31 16:28:13 +09:00]] 版)
<https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_DOM_access>