[165] window.open
は、
新しい閲覧文脈を開くことを求めるものです。
[75] Window
インターフェイスの
open
メソッドは、
新しい窓 (補助閲覧文脈) をポップアップするものです。
次の引数があります。
[32] Window
インターフェイスの
open
メソッドは、
次のようにしなければなりません >>31。
[8] Document
インターフェイスの
open
メソッドは、現在の文書を
document.write
によって指定した HTML ソースコードで置き換えるべく、
現在の内容を消去して構文解析器を起動するものです。次の引数があります。
Window
用の処理Document
用の処理[46] 文書を開く手順群は、 文書、型について、 次のようにしなければなりません。
null
でなく、
文書の活性構文解析器の script nesting level が正null
ではなく、
文書の閲覧文脈が
navigate
しようとしている場合、Document
が文書の場合、Window
の HTTPS状態を、
入口設定群オブジェクトの有責文書の Window
の HTTPS状態に設定します。loading
に設定します >>7。[45] 文書は、 ignore-opens-during-unload counter を持ちます >>7。
初期値は 0 です >>7。 prompt to unload a document や
unload a document からの document.open
を抑制するために使われます。
[158] 文書は、 throw-on-dynamic-markup-insertion counter
を持ちます >>157。 初期値は 0 です >>157。
カスタム要素構築器の実行中の document.open
や
document.write
を抑制するために使われます。
[123] かつては第1引数で HTML か平文かを指定できました。 平文の場合テキストファイルのDOM構築が行われていました。
[51] 第1引数の元々の意図は MIME型の指定だったようですが、実際には HTML かどうかの区別の意味しか無くなっていたようです。
[52] しかも元の文書のHTML構文解析器の動作中には必ず HTML と解釈されるようです。 IE と Firefox は構文解析器の停止後には平文にも対応するようですが、 Chrome は常に HTML と解釈します。
[54] デモ:
[93] document.open
は DOM0 時代の遺物です。当時は文書の要素の書き換えができなかった
(せいぜいフォーム制御子の現在の状態や画像の URL を変更できる程度だった)
ので、data:
URL もありませんから、
クライアント側で文書を生成する必要があれば document.open
を使う他ありませんでした。
[94] 現在となっては document.open
を使うべき理由はまったくありません。
実装により細かな挙動が異なり不安定なので、使うべきではありません。
[80] 新しい補助閲覧文脈が開かれる場合 (ポップアップの場合)、 第3引数 features の指示が適用されます。
[325] features 引数は JavaScript 1.0 時代からの超古参なのですが、 長らくどの仕様書も無視してまともに規定していませんでした。
[326] 平成時代後期になってようやく、紆余曲折ありつつも HTML Standard と CSSOM View に規定が入ったのですが、 その歴史的経緯のために規定が分散して入り組んだいびつな形のままになっています。
[77] 対象閲覧文脈が新しい閲覧文脈かつ補助閲覧文脈なら、
CSSOM View の規定を適用しなければなりません >>31。
[79] 次の機能があります。
noopener
] が存在する場合、noreferrer
] が存在する場合、noreferrer
] をboolean関数として構文解析した結果に設定します。noreferrer
] を削除します。[191] 機能分離子は、
ASCII空白と =
と ,
です。 >>31
[42] features引数の字句化は、 features を次のようにします >>31。
[175] 機能名を正規化するとは、 次の通り機能名を置き換えることをいいます。 >>31
[166] window.open
と document.open
は、
DOM0 で導入されました。
[5]
Latest topics > Chromeウィンドウを最前面にする・最背面にする - outsider reflex (Piro(SHIMODA Hiroshi) 著, 2007-09-29 12:59:12 +09:00
版) http://piro.sakura.ne.jp/latest/blosxom/mozilla/xul/2007-09-26_zlevel.htm
(名無しさん)
[6]
Firefox 2、Safari 3.1.1、Opera 9.27
のいずれも、
createDocument
で作成した Document
は HTMLDocument
ではなく、したがって
document.open()
は使えないようです。
[9] ブラウザごとのwindowオブジェクトの違いを理解する :CodeZine ( 版) http://codezine.jp/article/detail/3065?p=4
[10] Bug 325352 – document.open doesn't clear the document ( 版) https://bugzilla.mozilla.org/show_bug.cgi?id=325352
[11] window.openでポップアップブロックされた時の挙動はブラウザによって違う - SEの行き着くところ… ( 版) http://d.hatena.ne.jp/AWAWA/20090414/1239691058
[12] >>11 http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#dom-open, http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name
null
を返すのが仕様上正しい実装かな。不可視の閲覧文脈が選ばれているとみなすなら Opera も正しいといえるかも。
[13] Web Applications 1.0 r7304 Fix an infinite loop. There's no interop here, really, so I tried to find a compromise between what browsers do and keeping the requirements sane and simple. Tests at: http://www.hixie.ch/tests/adhoc/dom/level0/document/open/unload/ -- See also IRC ranting starting at http://krijnhoetmer.nl/irc-logs/whatwg/20120831#l-67 and ending at http://krijnhoetmer.nl/irc-logs/whatwg/20120901#l-140 ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7303&to=7304
[14] IRC logs: freenode / #whatwg / 20120831 ( ( 版)) http://krijnhoetmer.nl/irc-logs/whatwg/20120831
[15] [whatwg] Details on window.open ( ( 版)) http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038408.html
[16] Web Applications 1.0 r7593 Try to better define how popup blockers work. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7592&to=7593
[17] Web Applications 1.0 r7626 Make document.open() do nothing on non-active documents ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7625&to=7626
[18] Web Applications 1.0 r7729 document.open() legacy hack for compat ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7728&to=7729
[19] Web Applications 1.0 r8201 Make the parser not execute scripts pending for the document after document.open() has been called on it. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8200&to=8201
[20] Bug 25709 – Take over open() features argument spec http://dev.w3.org/csswg/cssom-view/#the-features-argument-to-the-open()-method ( ( 版)) https://www.w3.org/Bugs/Public/show_bug.cgi?id=25709
[21] Window.open - Web API Interfaces | MDN ( ( 版)) https://developer.mozilla.org/en-US/docs/Web/API/Window.open
[22] 解決:window.open()を使いつつIEでRefererを渡す方法 - @blog.justoneplanet.info ( ( 版)) http://blog.justoneplanet.info/2007/07/18/windowopen%E3%82%92%E4%BD%BF%E3%81%84%E3%81%A4%E3%81%A4ie%E3%81%A7referer%E3%82%92%E6%B8%A1%E3%81%99%E6%96%B9%E6%B3%95/
[23] Web Applications 1.0 r8701 Defer to CSSOM View for window.open(..., ..., features, ...) ( ( 版)) http://html5.org/r/8701
[24] IRC logs: freenode / #whatwg / 20140820 ( ( 版)) http://krijnhoetmer.nl/irc-logs/whatwg/20140820#l-856
[25] Web Applications 1.0 r8777 Recast window.open() in terms of an algorithm. ( ( 版)) https://html5.org/r/8777
[26] Web Applications 1.0 r8778 Simplify window.open even further ( ( 版)) https://html5.org/r/8778
[27] Web Applications 1.0 r8779 Fix window.open() to be more like deployed browsers rather than defaulting to 'about:blank'.]] ( ( 版)) https://html5.org/r/8779
[28] Web Applications 1.0 r8795 Match browsers better ( ( 版)) https://html5.org/r/8795
[29] Web Applications 1.0 r8816 Make window.open() match browsers better ( ( 版)) https://html5.org/r/8816
[30] RE: Figuring out the behavior of WindowProxy in the face of non-configurable properties ( (Travis Leithead 著, 版)) https://lists.w3.org/Archives/Public/public-script-coord/2015JanMar/0033.html
Internet Explorer 11 の環境で、DPI 値 を既定の 100% から変更していると、HTML アプリケーション (.hta) が縮小表示される場合があります。
HTML アプリケーションが frame 構造で、frame 内のコンテンツより window.open を使用して同一 frame 内にコンテンツを表示する場合、縮小表示される現象が発生します。
[3] Gecko、Opera は document.open
メソッドで開かれた文書の
charset を UTF-8、 WinIE は UTF-16 (unicode
)
にしますが、 WebKit は元(?)の charset を引き継ぎます。
[2] Part2 - browsersec - Browser Security Handbook, part 2 - Browser Security Handbook - Google Project Hosting ( 版) https://code.google.com/p/browsersec/wiki/Part2#Window_appearance_restrictions
[4] 717339 – Selection's Ranges should be removed on document.open() ( 版) https://bugzilla.mozilla.org/show_bug.cgi?id=717339
[35] Bug 9726 – Spec the features argument ( ( 版)) http://www.w3.org/Bugs/Public/show_bug.cgi?id=9726
[36] Inline Images on Web Pages ( ( 版)) http://elf.org/essay/inline-image.html
[37] [whatwg] location.reload() on document.open()ed documents ( ( 版)) http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029360.html
[38] Web Applications 1.0 r8058 Try to match reality a bit better for popup blockers. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8057&to=8058
[39] [whatwg] Details on window.open ( ( 版)) http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-July/040083.html
Web user agents MUST prevent web content from obscuring, hiding, or disabling user interfaces that display security context information, except in response to a user interaction.
User agents MUST restrict window sizing and moving operations consistent with section 7.1 Keep Security Chrome Visible. This prevents attacks wherein agent chrome is obscured by moving it off the edges of the visible screen.
User agents MUST NOT allow web content to open new windows with the agent's security UI hidden. Allowing this operation facilitates picture-in-picture attacks, where artificial chrome (usually indicating a positive security state) is supplied by the web content in place of the hidden UI.
User agents MUST prevent web content from overlaying chrome. This helps to ensure that user interactions that are perceived to target agent chrome are not redirected to Web applications.
[85] Integrate Fetch into HTML · whatwg/html@7c5555a ( 版) https://github.com/whatwg/html/commit/7c5555a16f2920c02244c10756bb2f1a11e87a22
[86] Add 'HTTPS state' to settings objects · whatwg/html@6de5241 ( 版) https://github.com/whatwg/html/commit/6de524157fcf341e10efb3eec634bcf7325e6ee4
window.open メソッドの dialog オプションが Web コンテンツから使用できなくなりました。この非標準機能は、最小化、最大化、復元ボタンをウィンドウのタイトルバーから取り除くものでしたが、Windows 版の Firefox とその他 Gecko ベースのブラウザしか対応していませんでした。
[95] Add and populate global object's "CSP list" · whatwg/html@479dfbf ( 版) https://github.com/whatwg/html/commit/479dfbf1ff68b746ed3f81cc7415165e3342709e
[97] Move 'HTTPS state' from Window to Document · whatwg/html@68390ce ( 版) https://github.com/whatwg/html/commit/68390cea99f9f19881a16e1c8adaf1b130b4d1cc
[99] Add a 'noopener' <link rel> keyword and window feature · whatwg/html@2992ea9 ( 版) https://github.com/whatwg/html/commit/2992ea921bc75e44157451a37a807a8ce0b9a884
[98] Per #290 window.open() can now return null · whatwg/html@1cf1475 ( 版) https://github.com/whatwg/html/commit/1cf14758fda3d7c157c0a89334bd3bc0cad7686e
[105] 27419 – Need to define that document.open() also creates a new Realm and global environment record per https://esdiscuss.org/topic/relationship-between-globals-realms-and-global-environment-records ( 版) https://www.w3.org/Bugs/Public/show_bug.cgi?id=27419
[106] Remove the storage mutex due to lack of implementation · whatwg/html@1b918cf ( 版) https://github.com/whatwg/html/commit/1b918cf72fcbba011f83b92ab5d1f483fb1cafa3
[107] Rewrite global object initialization to delegate to ES · whatwg/html@cf0355d ( 版) https://github.com/whatwg/html/commit/cf0355d7e0e229b98f7fbd51b8c7608010c787f5
[114] Rewrite script execution on top of ES · whatwg/html@4891d18 ( 版) https://github.com/whatwg/html/commit/4891d18aaf2df1d40aa61f467a5a10cfc19dd85d
例えば<a>タグ内にwindow.openを組み込んでいる場合、開いた別窓の下部にステータスバーが常時表示されてしまいます。またアドレスバーを非表示に設定しているときはタイトルバーのタイトルの前にドメイン名が表示されます。
[117] Fix #536: abort document.open() if origins mismatch · whatwg/html@05599ab ( 版) https://github.com/whatwg/html/commit/05599abc3f79d5ef644f9a8464532cc4626a3d46
[130] Tie Location to the Window object · whatwg/html@fdd8216 ( 版) https://github.com/whatwg/html/commit/fdd8216a902a065dd3e205cbbc1b5a6b527970a2
[131] Location has a strong tie with Window · Issue #24 · annevk/html-cross-origin-objects ( 版) https://github.com/annevk/html-cross-origin-objects/issues/24
[132] Tie Location to the Window object by annevk · Pull Request #584 · whatwg/html ( 版) https://github.com/whatwg/html/pull/584
[133] Make document.open() and close() check for an XML document · whatwg/html@0ee9935 ( 版) https://github.com/whatwg/html/commit/0ee993535960c18ea154ab6ec37fa62edcad1057
[134] Sync with recent changes to the JS spec's job queue · whatwg/html@5af258f ( 版) https://github.com/whatwg/html/commit/5af258f33e3e2f55eb30e611cb7aee625a8bd16a
[135] Clarify settings object, realm, and global relationships · whatwg/html@0866f1b ( 版) https://github.com/whatwg/html/commit/0866f1b3f4b4ea5a99a30909e9bbe557dea0b460
[136] Reset the "fired unload" flag at the end of document.open() · whatwg/html@1f6fa09 ( 版) https://github.com/whatwg/html/commit/1f6fa09728b2842091b401cfdcbf462944698e93
[143] Formalize custom element reactions · whatwg/html@27aa7bc ( 版) https://github.com/whatwg/html/commit/27aa7bc4fa6f168654a8c858f0773e611f679b39
[144] Assign document's origin during creation · whatwg/html@b94d600 ( 版) https://github.com/whatwg/html/commit/b94d600e0e4de5ddea2215078611d6dfd0800391
[145] Editorial: turn "exceptions enabled" into a flag ( (annevk著, )) https://github.com/whatwg/html/commit/879edbfcb25586caec8df93f303a434a700a18bc
[147] Use USVString for all URLs ( (domenic著, )) https://github.com/whatwg/html/commit/018b983b77b2cd908f6d00100e7e0abe893dd2c3
[148] Integrate with the Referrer Policy spec, part 2 of n ( (domenic著, )) https://github.com/whatwg/html/commit/176e74243c649b709b9959b7d08b327290c2f403
[149] Define the document's referrer in terms of Fetch ( (annevk著, )) https://github.com/whatwg/html/commit/148dcd7d8214433b80de92b19d27cc5de128f849
[151] Use relevant settings object for pushState/replaceState URL parsing (domenic著, ) https://github.com/whatwg/html/commit/b568cf93ac374c440e29e01a2619365dde7c45c8
[152] Remove the "replace" argument to window.open() (domenic著, ) https://github.com/whatwg/html/commit/f444d452cb062ba848570c7b69e6cfcf8aac5c62
[156] Make document.write etc. throw during parsing custom elements (domenic著, ) https://github.com/whatwg/html/commit/00c6fa07bdb9f0d08a28f6c6e1ababca7d08618c
[161] Do not throw when window.open() is popup blocked (annevk著, ) https://github.com/whatwg/html/commit/fbbc480d527224afbff15d5ec4284ab8cbd0a1a4
[164] Return null when window.open() is popup blocked (annevk著, ) https://github.com/whatwg/html/commit/29ded68f4147ad84c12a2a08b1db817a790c3c09
[167] Clarify origin check in document.open() (jeisinger著, ) https://github.com/whatwg/html/commit/87e60aba2af808d16201d906101e93d0c62b8339
[168] Add additional feature names to window.open() · Issue #2464 · whatwg/html () https://github.com/whatwg/html/issues/2464
[169] [cssom-view] Move tokenizing of window.open's features arg to HTML (zcorpan著, ) https://github.com/w3c/csswg-drafts/commit/48c88c28bdc9a1ef2e52e38544cf7f90517b72e0
[170] [cssom-view] Make window.open's features use Web-exposed screen area (zcorpan著, ) https://github.com/w3c/csswg-drafts/commit/80c0561f714b96ae696d17f46774b26c1d251e90
[171] Specify the tokenizer for window.open's features argument (zcorpan著, ) https://github.com/whatwg/html/commit/b649435b454f5a3243a84b694c8555e327fe87a8
[176] Make window.open() throw for URL parser failures (annevk著, ) https://github.com/whatwg/html/commit/ea52bf4d50cfb4ef88489bff76276b660b40781b
[181] Revamp the rules for choosing a browsing context (annevk著, ) https://github.com/whatwg/html/commit/5578a0495f826a56597288b7ba1f71163f17cdd6
[182] Editorial: refactor document.open()/write()/writeln() (annevk著, ) https://github.com/whatwg/html/commit/d43b7050b4fe83ebce7724ea005e4707f06a86f7
[225] Clarify document.open() and refactor window.open() (annevk著, ) https://github.com/whatwg/html/commit/29afad43e373140a6c59e2e99753e8f2da1c7c70
[258] Centralize setting the active document (annevk著, ) https://github.com/whatwg/html/commit/4257a9bf03f8ebbd6cc8b41933b6c5b619611662
[259] 27875 – Abstract the parts of window.open that deal with about:blank () https://www.w3.org/Bugs/Public/show_bug.cgi?id=27875
[260] Make noopener stop the copying of session storage (mystor著, ) https://github.com/whatwg/html/commit/a68a1f712b641981d7367d78758596b21a04521c
[262] Mention sessionStorage copying in logic for creating a new browsing context by mystor · Pull Request #2832 · whatwg/html () https://github.com/whatwg/html/pull/2832
[263] Regression fix: continue to defer to CSSOM for window.open()'s features (annevk著, ) https://github.com/whatwg/html/commit/e1533f1dbb7405ffc0814bbc4eaf9e8b0442c035
[264] Regression fix: tokenize features earlier in window.open() (annevk著, ) https://github.com/whatwg/html/commit/0ce114d22c285dd52c64c5f00b2185e4ed8edf84
[265] Window open steps use tokenizedFeatures before setting it · Issue #3107 · whatwg/html () https://github.com/whatwg/html/issues/3107
[266] Regression fix: tokenize features earlier in window.open() by annevk · Pull Request #3108 · whatwg/html () https://github.com/whatwg/html/pull/3108
[267] Remove the 'opener' restriction. (mikewest著, ) https://github.com/w3c/webappsec-secure-contexts/commit/98f2c2634f7371bca6ffacbf73e984b22af521ab
[268] Should opener be taken into consideration when determining if a context is secure? · Issue #42 · w3c/webappsec-secure-contexts () https://github.com/w3c/webappsec-secure-contexts/issues/42
[269] Cleaning up algorithms and issues. (mikewest著, ) https://github.com/w3c/webappsec-secure-contexts/commit/2cc0b2f634b5062f82d540349233d30cab84e0c3
[270] Editorial: Define "realm execution context" in a separate step (TimothyGu著, ) https://github.com/whatwg/html/commit/b5f9ad629cb498206bd9e4144de9ec58e27fef98
[271] Editorial: Define "realm execution context" in a separate step by TimothyGu · Pull Request #3314 · whatwg/html () https://github.com/whatwg/html/pull/3314
[272] Integrate Feature Policy: "sync-xhr" (clelland著, ) https://github.com/whatwg/xhr/commit/67a423f9f5d95ee240d48d4cf82c57e2d33876a2
[273] Allow developers to opt-out of sync XHR with feature policy · Issue #178 · whatwg/xhr () https://github.com/whatwg/xhr/issues/178
[274] Integrate feature policy by clelland · Pull Request #177 · whatwg/xhr () https://github.com/whatwg/xhr/pull/177
[275] Feature proposal: sync-xhr · Issue #126 · WICG/feature-policy () https://github.com/WICG/feature-policy/issues/126
[276] Remove processing for document.open()'s type parameter (annevk著, ) https://github.com/whatwg/html/commit/ac52e65a6a37b6c4163de32082a50c7da15c6c96
[186] document.open() doesn't set contentType (document's content type) · Issue #3546 · whatwg/html () https://github.com/whatwg/html/issues/3546
[187] Remove processing for document.open()'s type parameter by annevk · Pull Request #3559 · whatwg/html () https://github.com/whatwg/html/pull/3559
[192] Use DOM's "replace all" primitive in document.open() (annevk著, ) https://github.com/whatwg/html/commit/423c66403522b09138dc3b366bf96111bc030a04
[204] Use DOM's "replace all" primitive in document.open() by annevk · Pull Request #3598 · whatwg/html () https://github.com/whatwg/html/pull/3598
[205] Introduce "remove all event listeners" primitive by annevk · Pull Request #641 · whatwg/dom () https://github.com/whatwg/dom/pull/641
[206] Clarify document.open() event listener removal (annevk著, ) https://github.com/whatwg/html/commit/d5903c45237223c9b57aca1c4271414232be7209
[208] It is unclear whether "Unregister all event listeners registered on the Document node and its descendants." means also nodes in shadow DOM · Issue #2302 · whatwg/html () https://github.com/whatwg/html/issues/2302
[243] Clarify document.open() event listener removal by annevk · Pull Request #3653 · whatwg/html () https://github.com/whatwg/html/pull/3653
[244] Make document.open() not reset the encoding to UTF-8 (annevk著, ) https://github.com/whatwg/html/commit/fdbeb95b40d8d355549bb7f9b28647ed560a67d3
[232] [] (0) Make document.open() reset the character encoding to UTF-16. M… (Hixie著, ) https://github.com/whatwg/html/commit/37c4d16c18fc33eeb40f820ca88209284761a25b
[277] [giow] (2) Make document.open() reset the charset to UTF-8 instead of… (Hixie著, ) https://github.com/whatwg/html/commit/011b5e8403a557071961eb3f54bcee8dfa01138c
[278] Make document.open() not reset the encoding to UTF-8 by annevk · Pull Request #3661 · whatwg/html () https://github.com/whatwg/html/pull/3661
[279] 380383 - [FIX]about:blank encoding is not consistent () https://bugzilla.mozilla.org/show_bug.cgi?id=380383
[280] Editorial: separate out document.open() methods definitions (TimothyGu著, ) https://github.com/whatwg/html/commit/8f2816a2e89ce5614fac92ce2a8185070fc6b6e7
[281] Separate out document.open() method declaration definitions · Issue #3565 · whatwg/html () https://github.com/whatwg/html/issues/3565
[282] Editorial: separate out document.open() methods definitions by TimothyGu · Pull Request #3778 · whatwg/html () https://github.com/whatwg/html/pull/3778
[283] Fix calls to InitializeHostDefinedRealm (TimothyGu著, ) https://github.com/whatwg/html/commit/39c948ba5ec55677e209bc4fc631636f1e8e2baf
[115] Revise event listener removal in document.open() (TimothyGu著, ) https://github.com/whatwg/html/commit/823f4bcb5a4d80b231c81503dbc7c71c209617e5
[286] Revise event listener removal in document.open() by TimothyGu · Pull Request #3893 · whatwg/html () https://github.com/whatwg/html/pull/3893
[47] 文書の singleton を置き換える際、具体的にどのオブジェクトが該当するかは、 例示にとどまっていて、完全なリストはありません。
[48] 次のものが該当します。
[49] 大域オブジェクトも置き換わるので、他のフラグの再設定も合わせて、
document
オブジェクトへの参照がすべて別の文書に書き換わったのとほぼ同じ結果となるようです。しかし引き継がれる状態もあるようです。
[62] 自文書を document.open
するスクリプトの
document.open
前に window
の expando
を設定し、後に参照すると、 IE と Firefox では undefined
になっていますが (仕様通り)、 Chrome では前と同じ値が得られます。
[63] var
で宣言した変数はどのブラウザーでも前後同じ値が得られます。
前に var
で宣言した変数に後で window
からアクセスしてもどのブラウザーでも undefined
になります。
前に expando で設定したのと同じ名前の var
に後でアクセスしても、
どのブラウザーでも undefined
になります。
[64] Chrome では history
や location
や document.forms
にアクセスしても、前と同じ値が得られます。
IE と Firefox では違う値になります。
[82] Chrome では適切な雛形内容所有子文書は変化しないように見えます。
[287] document.open() simplifications, part 1 (TimothyGu著, ) https://github.com/whatwg/html/commit/6f769b8089a843066aa19f5991405bf4c84458b3
次の挙動は廃止されました。
beforeunload
, unload
の呼び出しWindow
の差し替え[109] Investigate a new document.open() by annevk · Pull Request #3651 · whatwg/html () https://github.com/whatwg/html/pull/3651
[110] Calling InitializeHostDefinedRealm in document.open is probably unnecessary · Issue #1698 · whatwg/html () https://github.com/whatwg/html/issues/1698
[111] Calling InitializeHostDefinedRealm in document.open is probably unnecessary · Issue #1698 · whatwg/html () https://github.com/whatwg/html/issues/1698
[112] document.open URL handling is fishy · Issue #3286 · whatwg/html () https://github.com/whatwg/html/issues/3286
[113] How should document.open handle the beforeunload handler tearing down the world? · Issue #3306 · whatwg/html () https://github.com/whatwg/html/issues/3306
[142] No longer remove tasks for document.open() by annevk · Pull Request #3665 · whatwg/html () https://github.com/whatwg/html/pull/3665
[219] document.open() simplifications: realm creation, unloading, tasks removal by TimothyGu · Pull Request #3918 · whatwg/html () https://github.com/whatwg/html/pull/3918
[220] Editorial: Remove parameters from document.open() references (TimothyGu著, ) https://github.com/whatwg/html/commit/288fc16a27fc2c2990f87c9270f4ae22022a17a5
[221] document.open() simplifications, part 2 by TimothyGu · Pull Request #3946 · whatwg/html () https://github.com/whatwg/html/pull/3946
[222] document.open() simplifications, part 2 (TimothyGu著, ) https://github.com/whatwg/html/commit/ae7cf0cc1936c6c309d7279c822dffc3af147851
[139] document.open() can make a document's URL go out of sync with its history entry · Issue #3885 · whatwg/html () https://github.com/whatwg/html/issues/3885
[210] At least Blink does not support document.open()'s replace parameter · Issue #3564 · whatwg/html () https://github.com/whatwg/html/issues/3564
[211] document.open() can make a document's URL go out of sync with its history entry · Issue #3885 · whatwg/html () https://github.com/whatwg/html/issues/3885
[212] document.open() simplifications, part 2 by TimothyGu · Pull Request #3946 · whatwg/html () https://github.com/whatwg/html/pull/3946
[213] Editorial: Factor out history.push/replaceState() steps (TimothyGu著, ) https://github.com/whatwg/html/commit/f42dcf0bf2ebf86bc5ca79aecea098a8fed6cf3e
[60] document.open
で作られた文書の再読込や履歴の移動も、
あたかも通常のページであるかのように扱われることが意図されているようですが、
実装も仕様書も不安定な状態のようです。
[65] 閲覧文脈閲覧文脈の再読込は、 document.open
後の時、
通常の処理ではなく overridden reload となります。
overridden reload は次のようにしなければなりません。
location.reload
も参照。[59] 文書は、 reload override flag と
reload override buffer を持ちます >>58。
初期状態では未設定で >>58、 document.open
などが設定することがあります。
[61] IE と Firefox は overridden reload に対応しているようですが、 Chrome は対応していないようです。
[55] IE は平文を location.reload
した後も平文として扱うようです。
Firefox は平文でも location.reload
後に HTML
にしてしまうようです。現在の HTML Standard は Firefox
の動作です。
[68] document.open
で作られた文書から他の文書に移動したら、
元の文書は通常通り処理されます。 document.open
から再度 document.open
を再度実行したら、
前の状態は document.write
で生成されたソースコードで保存されます
(>>56)。
[57] >>56 は Firefox の動作で、 IE は文書の reload override flag
が偽なら navigate の新しい資源をソースでなく URL としているようです。
(最初の document.open
より前のセッション履歴エントリーに戻った時にネットワークアクセスが発生します。そちらの仕様なら、 script-created parser でない普通の構文解析器の時に、構文解析したテキストを保持し続けずに済みます。)
[214] Remove overridden reload concept (TimothyGu著, ) https://github.com/whatwg/html/commit/6440ccae7340ea41d3eb5bf8ff0b3b27363eda85
[56] 556002 - document.open() and write() after parsing is complete breaks reload button - we reload new, not original document () https://bugzilla.mozilla.org/show_bug.cgi?id=556002
[215] document.open() simplifications, part 2 by TimothyGu · Pull Request #3946 · whatwg/html () https://github.com/whatwg/html/pull/3946
[216] Make document.open() set the document to no-quirks (TimothyGu著, ) https://github.com/whatwg/html/commit/7d21798e5d546ab7012eb47e83d736fdf38c9209
[218] Tracking issue for document.open() overhaul · Issue #3818 · whatwg/html () https://github.com/whatwg/html/issues/3818
[227] Document open steps and quirks mode · Issue #3831 · whatwg/html () https://github.com/whatwg/html/issues/3831
[228] Document open steps and quirks mode · Issue #3831 · whatwg/html () https://github.com/whatwg/html/issues/3831
[231] Make document.open() set the document to no-quirks by TimothyGu · Pull Request #3966 · whatwg/html () https://github.com/whatwg/html/pull/3966
[233] document.open(): remove fragment before propagating entry document's URL (TimothyGu著, ) https://github.com/whatwg/html/commit/ae688ea9845f145d6a7b31c67e727b56442ceada
[242] Unclear what to do with fragments on document.open · Issue #2555 · whatwg/html () https://github.com/whatwg/html/issues/2555
[245] document.open(): remove fragment before propagating entry document's URL by TimothyGu · Pull Request #3970 · whatwg/html () https://github.com/whatwg/html/pull/3970
[288] Allow document.open()/write() to be called on non-active documents (TimothyGu著, ) https://github.com/whatwg/html/commit/ad541d6a5e74f56dccedc56d50750adb65184505
[284] Extend document.open/write to non-active documents · Issue #2827 · whatwg/html () https://github.com/whatwg/html/issues/2827
[289] Allow document.open() to be called on non-active documents by TimothyGu · Pull Request #3977 · whatwg/html () https://github.com/whatwg/html/pull/3977
[290] document.open(): only abort when there is a navigation (TimothyGu著, ) https://github.com/whatwg/html/commit/1ca520a308ffd6a3c5f7fc26a67338c145af8376
[291] Unclear what exactly should be aborted in document.open() · Issue #3975 · whatwg/html () https://github.com/whatwg/html/issues/3975
[292] Investigate a new document.open() by annevk · Pull Request #3651 · whatwg/html () https://github.com/whatwg/html/pull/3651
[293] document.open(): only abort when there is a navigation by TimothyGu · Pull Request #3999 · whatwg/html () https://github.com/whatwg/html/pull/3999
[294] Check there is a browsing context in document.open()'s abort step (TimothyGu著, ) https://github.com/whatwg/html/commit/ff800ef6e917a70169f8bbbefa5ae7e47022fd55
[295] document.open(): only abort when there is a navigation by TimothyGu · Pull Request #3999 · whatwg/html () https://github.com/whatwg/html/pull/3999
[296] document.open(): Check there is a browsing context by TimothyGu · Pull Request #4011 · whatwg/html () https://github.com/whatwg/html/pull/4011
[297] Request Fullscreen take additional options · Issue #123 · whatwg/fullscreen () https://github.com/whatwg/fullscreen/issues/123
[298] Return nullable WindowProxy from document.open(url, name, features) (dguenther著, ) https://github.com/whatwg/html/commit/ba1c3c366ac08e7f6984460a9c83a135c66c2fea
[299] Document.open(url, name, features) should return nullable WindowProxy · Issue #4091 · whatwg/html () https://github.com/whatwg/html/issues/4091
[300] Return nullable WindowProxy from Document.open(url, name, features) by dguenther · Pull Request #4092 · whatwg/html () https://github.com/whatwg/html/pull/4092
[301] Change an exception name in document.open() to "InvalidAccessError" (foolip著, ) https://github.com/whatwg/html/commit/5f597504213a10a52536c1f95d15862398dec854
[302] Change an exception name in document.open() to "InvalidAccessError" by foolip · Pull Request #4066 · whatwg/html () https://github.com/whatwg/html/pull/4066
[303] Should document.open really change the URL but leave the serialized state? · Issue #4285 · whatwg/html () https://github.com/whatwg/html/issues/4285
[306] Disallow window.open() during unload (TimothyGu著, ) https://github.com/whatwg/html/commit/3b401f95ce6d81040b6f1a9f0f89e054f277206b
[307] Disallow window.open() during unload by TimothyGu · Pull Request #3960 · whatwg/html () https://github.com/whatwg/html/pull/3960
[308] Ignore document.open/write after the active parser has been aborted (foolip著, ) https://github.com/whatwg/html/commit/ead4aa8ec576d7d330a04f7ec8508e336b895fdb
[310] Consider adding an "ignore document.open/write" flag on document · Issue #4723 · whatwg/html · GitHub () https://github.com/whatwg/html/issues/4723
[311] Ignore document.open/write after the active parser has been aborted by foolip · Pull Request #4907 · whatwg/html · GitHub () https://github.com/whatwg/html/pull/4907
[315] Support noreferrer for window.open() (annevk著, ) https://github.com/whatwg/html/commit/a9a7944f20ec9223c252578db3e8bf870bca5718
[321] Support "noreferrer" for window.open() by annevk · Pull Request #4331 · whatwg/html () https://github.com/whatwg/html/pull/4331
[322] Editorial: use responsible document a little less (annevk著, ) https://github.com/whatwg/html/commit/7ba98545162f90439d4ae478c3abacdb6c818c98
[323] Consider removing settings object's responsible document · Issue #4335 · whatwg/html () https://github.com/whatwg/html/issues/4335
[324] Editorial: use responsible document a little less by annevk · Pull Request #4394 · whatwg/html () https://github.com/whatwg/html/pull/4394
[327] Remove noopener/noreferrer from tokenizedFeatures (annevk, , ) https://github.com/whatwg/html/commit/c0b75ea89eaecc858ccc16b45bc81a75d4e716a7
[331] noopener window.open feature seems pretty broken as implemented in browsers · Issue #1902 · whatwg/html () https://github.com/whatwg/html/issues/1902
[334] Add additional feature names to window.open() · Issue #2464 · whatwg/html () https://github.com/whatwg/html/issues/2464
[335] [cssom-view] Specify aliases for window.open feature names by zcorpan · Pull Request #1128 · w3c/csswg-drafts () https://github.com/w3c/csswg-drafts/pull/1128
[336] window.open with features (, ) https://arai-a.github.io/window-open-features/
[337] window.open with features (, ) https://arai-a.github.io/window-open-features/proposal.html
[338] Remove noopener from tokenizedFeatures by annevk · Pull Request #3297 · whatwg/html () https://github.com/whatwg/html/pull/3297