開闢子閲覧文脈

window.opener (DOM)

[36] window.opener は、window.open で開いた閲覧文脈内のスクリプトから、元の閲覧文脈へとアクセスするための特性です。

仕様書

window.opener (DOM)

[17] Window インターフェイスopener IDL属性取得器は、 次のようにしなければなりません >>16

  1. [58] 現在を、 文脈オブジェクト閲覧文脈に設定します。
  2. [69] 現在null か、 現在廃除済みか、 現在opener閲覧文脈null の場合、
    1. [62] null を返します。
  3. [59] それ以外の場合、
    1. [18] 現在opener閲覧文脈WindowProxy を返します。

[26] Window インターフェイスopener IDL属性設定器は、 指定値について、次のようにしなければなりません >>16

  1. [19] 指定値null の場合、
    1. [60] 文脈オブジェクト閲覧文脈nullない場合、
      1. [20] 文脈オブジェクト閲覧文脈について廃除します。
  2. [29] それ以外の場合、
    1. [30] OrdinaryDefineOwnProperty を実行します。
      オブジェクト
      文脈オブジェクト
      property key
      opener
      Property Descriptor
      Value
      指定値
      Writable
      Enumerable
      Configurable
      例外投げられたら、再び投げます。
[35] opener という名前の通常の JavaScript変数が使われることがあるため、値を一度設定したら IDL属性ではなくなる、 というかなり特殊な設定器となっています。

[15] 補助閲覧文脈は、 opener閲覧文脈廃除済み (disowned) (初期値は) を持ちます >>13

[14] opener閲覧文脈 (opener browsing context) は、 補助閲覧文脈が作成された元の閲覧文脈です >>13

[31] opener閲覧文脈は、直接到達可能閲覧文脈かどうかや familiar with かどうかの決定に影響します。

[32] opener閲覧文脈は、作成子閲覧文脈ともなることがあります。

[33] ある閲覧文脈opener閲覧文脈という関係は、 廃除 (disown its opener) >>16 されることがあります。 これは、スクリプトから window.opener を通して opener閲覧文脈へのアクセスをできなくする(なる)ことをいいます。

他の変数等で依然としてアクセス可能な場合もありますが、 opener閲覧文脈ではなくなります。

[34] disown されるのは、次の場合です。

リンク型 noopener

[9] リンク型 noopener は、 新しい閲覧文脈を開いた時に window.openernull とするべきことを示します。

[10] noopener は、 a 要素area 要素rel 属性で使うことができます >>8

[11]リンク型ハイパーリンクを作成するものではなく、注釈となるもの (hypertext annotation) です。 (他にリンク型を作成するハイパーリンクが無い時は、 暗示的に作成されるハイパーリンクを注釈付けするものです。) >>8

[12] この性質は noreferrer と似ています。

window.open の機能 noopener

[38] window.opener の第3引数 features の字句 noopener >>37 は、新しい閲覧文脈を開いた時、 その関係を切ることを求めるものです。

[39] これが指定された場合、新しい閲覧文脈側の window.openernull となります。 window.opennull を返し、新しい閲覧文脈を返しません。

歴史

[1] Web Applications 1.0 r7941 Example window.opener cross-origin. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7940&to=7941

[2] Bug 21946 – Ignoring non-null values of opener does not seem to be web-compatible ( ( 版)) https://www.w3.org/Bugs/Public/show_bug.cgi?id=21946

[3] Web Applications 1.0 r8235 Try to make window.opener more compatible ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8234&to=8235

[4] [whatwg] Effect on window.opener when navigating an existing window using window.open ( ( 版)) http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-April/126955.html

[5] Web Applications 1.0 r8652 Turns out window.opener is set to all kinds of crazy things and we shouldn't fire TypeError for them ( ( 版)) http://html5.org/r/8652

[6] IRC logs: freenode / #whatwg / 20151105 ( 版) http://krijnhoetmer.nl/irc-logs/whatwg/20151105#l-441

[7] Add a 'noopener' <link rel> keyword and window feature · whatwg/html@2992ea9 ( 版) https://github.com/whatwg/html/commit/2992ea921bc75e44157451a37a807a8ce0b9a884

[211] Add a 'noopener' link attribute by mikewest · Pull Request #290 · whatwg/html ( 版) https://github.com/whatwg/html/pull/290

[40] Popups from non-secure contexts now require `noopener` to be consider… · w3c/webappsec-secure-contexts@b062415 ( 版) https://github.com/w3c/webappsec-secure-contexts/commit/b062415fb3b1213b37ecce5c63e70f48888c6f8d

[41] 28821 – add rel=newcontext ( 版) https://www.w3.org/Bugs/Public/show_bug.cgi?id=28821

[42] About rel=noopener ( 版) https://mathiasbynens.github.io/rel-noopener/

[43] Fixing some links and cleaning up lists. (mikewest著, ) https://github.com/w3c/webappsec-secure-contexts/commit/5f36532e8909c8bf72daa431724b6372bc5366ab

[44] Improve navigate for service worker hooks (jungkees著, ) https://github.com/whatwg/html/commit/2b93f9ec35b152e58d3e181bea8c45d789bac949

[45] Release Notes for Safari Technology Preview 17 | WebKit ( ()) https://webkit.org/blog/7071/release-notes-for-safari-technology-preview-17/

Implemented rel=noopener (r207840)

[46] Clarify rel=noopener & "disown opener" effects (sideshowbarker著, ) https://github.com/whatwg/html/commit/b2762db3980154c016a07752fd0feebb0f6581d5

[47] About rel=noopener () https://mathiasbynens.github.io/rel-noopener/

[48] Stubbing out 'disown-opener'. (mikewest著, ) https://github.com/w3c/webappsec-csp/commit/68330f35ba42ffc426aee26715968d7a2ee203c6

[49] Breaking the `opener` relationship. (Mike West著, ) https://lists.w3.org/Archives/Public/public-webappsec/2017Apr/0071.html

[50] Mark a few things as WIP. (mikewest著, ) https://github.com/w3c/webappsec-csp/commit/eff9c9c3277e108d243d44fa21924f532b6b1a87

[51] Make noopener stop the copying of session storage (mystor著, ) https://github.com/whatwg/html/commit/a68a1f712b641981d7367d78758596b21a04521c

[52] 1372662 - Don't copy SessionStore when creating a window with noopener () https://bugzilla.mozilla.org/show_bug.cgi?id=1372662

[53] Mention `sessionStorage` copying in logic for creating auxiliary browsing contexts · Issue #2681 · whatwg/html () https://github.com/whatwg/html/issues/2681

[54] 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

[55] 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

[56] "On setting, if the new value is null then the c..." · Issue #3351 · whatwg/html () https://github.com/whatwg/html/issues/3351

[57] Editorial: cleanup window.opener (annevk著, ) https://github.com/whatwg/html/commit/15317c7a58040af294510e7511c0512a19083ffb

[21] Editorial: cleanup window.opener by annevk · Pull Request #3448 · whatwg/html () https://github.com/whatwg/html/pull/3448

[22] Editorial: cleanup window.opener by annevk · Pull Request #3448 · whatwg/html () https://github.com/whatwg/html/pull/3448

[23] Fix #313: make disowning disown the opener browsing context too by annevk · Pull Request #323 · whatwg/html () https://github.com/whatwg/html/pull/323

[24] Meltdown/Spectre  |  Web  |  Google Developers () https://developers.google.com/web/updates/2018/02/meltdown-spectre

[25] Editorial: fix confusing phrasing for opener setter (domenic著, ) https://github.com/whatwg/html/commit/fefb8792a278bc2568a038bb1135862921ea365e

[27] "opener" setter says to return things, but setters can't return stuff · Issue #3904 · whatwg/html () https://github.com/whatwg/html/issues/3904

[28] Editorial: fix confusing phrasing for opener setter by domenic · Pull Request #3916 · whatwg/html () https://github.com/whatwg/html/pull/3916

[63] Removed disown-opener (#327) (andypaicu著, ) https://github.com/w3c/webappsec-csp/commit/52b71625bd6ed7123615e9d7c159f9ad805a5ba7

[64] Removed disown-opener as it will not make it into CSP3 by andypaicu · Pull Request #327 · w3c/webappsec-csp () https://github.com/w3c/webappsec-csp/pull/327

[65] CSP3: Add something along the lines of `disown-window-owner`. · Issue #139 · w3c/webappsec () https://github.com/w3c/webappsec/issues/139

[66] Safari 12.1 Release Notes | Apple Developer Documentation () https://developer.apple.com/documentation/safari_release_notes/safari_12_1_release_notes

Updated the link behavior for "target=_blank" to include rel="noopener" implicitly.

[67] Consider not setting browsing context name when noopener/noreferrer are used · Issue #4314 · whatwg/html () https://github.com/whatwg/html/issues/4314

[68] Define Window's opener when there's no browsing context (annevk著, ) https://github.com/whatwg/html/commit/7c9a8c0a382cfc2a0d193daff2f2fb95beef5a0b

[61] Define Window's opener when there's no browsing context by annevk · Pull Request #4379 · whatwg/html () https://github.com/whatwg/html/pull/4379

[70] Support noreferrer for window.open() (annevk著, ) https://github.com/whatwg/html/commit/a9a7944f20ec9223c252578db3e8bf870bca5718

[71] Editorial: inline noreferrer processing model (annevk著, ) https://github.com/whatwg/html/commit/f47773d25a7b1a3a03c1047bbc4037d08639cf9b

[72] noopener window.open feature seems pretty broken as implemented in browsers · Issue #1902 · whatwg/html () https://github.com/whatwg/html/issues/1902

[73] CSP3: Add something along the lines of `disown-window-owner`. · Issue #139 · w3c/webappsec () https://github.com/w3c/webappsec/issues/139

[74] Links to Unrelated Browsing Contexts - WHATWG Wiki (, ) https://wiki.whatwg.org/wiki/Links_to_Unrelated_Browsing_Contexts

[75] 69267 - Provide an explicit way to suggest opening a link in a new process () https://bugs.chromium.org/p/chromium/issues/detail?id=69267

[76] Deprecate rel="noopener" · Issue #2119 · whatwg/html () https://github.com/whatwg/html/issues/2119

[77] Remove noopener from tokenizedFeatures by annevk · Pull Request #3297 · whatwg/html () https://github.com/whatwg/html/pull/3297