[36] [DFN[[CODE(URI)@en[[[javascript:]]]] [[URL]]]] は、 [[Webブラウザー]]によって
[[JavaScript]] として解釈され、実行される [[URL]] です。

* 仕様書

[REFS[
- [67] [CITE@en[URL schemes - WHATWG Wiki]] ([TIME[2014-10-12 01:44:12 +09:00]] 版) <https://wiki.whatwg.org/wiki/URL_schemes#javascript:_URLs>
- [35] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-03-05 09:33:40 +09:00]] 版) <https://html.spec.whatwg.org/#javascript-protocol>
]REFS]

* 構文

[60] [CODE(URI)@en[[[javascript:]]]] [[URL]] は、 [[URL scheme]]
である [CODE(URI)@en[[[javascript]]]] と区切りの [CODE[[[:]]]]
の後に [[JavaScript]] の[[ソースコード]]を指定するものです。
ただし、[[ソースコード]]の部分は[[パーセント符号化]]を使うことができます。

[FIG(railroad)[
= [CODE(URL)@en[[[javascript:]]]]
= [[パーセント符号化]]された [[JavaScript]] コード
]FIG]

[61] [[URL query]] や[[素片識別子]]は使うことができず、 [CODE[[[?]]]] や
[CODE[#]] も含めてすべて [[JavaScript]] の一部と解釈されます [SRC[>>67]]。

[68] [[JavaScript]] コードの先頭の [[U+FEFF]] は、 [[BOM]] とみなされます [SRC[>>67]]。

;; [69] [[HTML]] の [[navigate]] にはこれに対応する規定がありません。
[[JavaScript]] としては [[BOM]] でなくても [[U+FEFF]] は無視されるため、結果同じとなります。

* navigate 演算

[21] [[URL scheme]] が [CODE(URI)@en[[[javascript:]]]] な [[URL]]
への [[navigate]] は、 
指定された
[[URL]]
に含まれる
[[JavaScript]]
コードを実行して、
その結果を表示する操作となります。

[120] 
[DFN[[RUBYB[[CODE[javascript:]] URL要求を実行][execute a [CODE[javascript:]] URL request]]]]は、
[[要求]][VAR[要求]]、
[[閲覧文脈]][VAR[始点]]、
[[閲覧文脈]][VAR[閲覧文脈]]について、
次のようにします。
[SRC[>>35]]

[FIG(steps)[

= [80] [VAR[応答]]を、
新しい [CODE(HTTP)[[[204]]]] [[応答]]に設定します。
[FIG(list members)[ [121] [[応答]]

:[F[状態][状態符号]]:[CODE(HTTP)[204]]

]FIG]
= [24] 
[VAR[始点]]の[F[活性文書]]の[F[起源][文書の起源]]と[VAR[閲覧文脈]]の[F[活性文書]]の[F[起源][文書の起源]]が[[同じ起源]]であって、
[VAR[要求]]、
[CODE[other]]、
[VAR[始点]]、
[VAR[閲覧文脈]]について
[[Should navigation request of type from source in target be blocked by Content Security Policy?]]
が
[CODE[Allowed]]
を返す場合、
== [94] 
[VAR[URL文字列]]を、
[VAR[要求]]の [F[URL][要求URL]] 
に[[URL直列化器]]を適用した結果に設定します。
== [122] 
[VAR[URL文字列]]の先頭の
[CODE[javascript:]]
を除去します。
== [123] 
[VAR[スクリプトソース]]を、
[VAR[URL文字列]]に[[文字列パーセント復号]]を適用した結果を
[[UTF-8復号]]した結果に設定します。
== [116] 
[VAR[閲覧文脈]]の[F[活性文書]]の[F[URL][文書の番地]]を、
[VAR[要求]]の[F[URLリスト]]の[[末尾に追加][list append]]します。
== [85] [VAR[設定群]]を、
[VAR[閲覧文脈]]の[F[活性文書]]の[F[関連設定群オブジェクト]]に設定します。
== [53] [VAR[スクリプト]]を、
[[古典スクリプトを作成]]した結果に設定します。
[FIG(list members)[

: [VAR[[[スクリプト]]ソース]] : [VAR[スクリプトソース]]
: [VAR[[[環境設定群オブジェクト]]]] : [VAR[設定群]]
: [VAR[[[基底URL]]]] : [VAR[設定群]]の[F[API基底URL]]
: [VAR[スクリプトfetchオプション群]] : [[既定古典スクリプトfetchオプション群]]

]FIG]
== [54] 
[VAR[評価状態]]を、
[VAR[スクリプト]]について[[古典スクリプトを実行]]した結果に設定します。
== [104] [VAR[評価状態]]が
[[abrupt completion]]
の場合、
または[VAR[評価状態]]の[F(ss)[値]]が[[空]]の場合、
=== [105] 
[VAR[結果]]を、
[[未定義]]に設定します。
== [106] それ以外の場合、
=== [107] 
[VAR[結果]]を、
[VAR[評価状態]]の[F(ss)[値]]に設定します。
== [55] 
[CODE[[[Type]]([VAR[結果]])]] が [CODE(JS)@en[String]] 
の場合、
=== [81] [VAR[応答]]を、
新しい[[応答]]に設定します。
[FIG(list members)[ [52] [[応答]]

:[F[[[ヘッダーリスト]]]]:
[FIG(list members)[

:[CODE(HTTP)@en[Content-Type]]:[CODE(MIME)@en[text/html]]
: [CODE(HTTP)@en[Referrer-Policy]] : [VAR[設定群]]の[F[参照元ポリシー]]

]FIG]
:[F[本体][応答本体]]: [VAR[結果]]
: [F[HTTPS状態]] : [VAR[設定群]]の[F[HTTPS状態]]

]FIG]
= [56] 
[VAR[応答]]を返します。
]FIG]


[EG[
[58] [CODE(HTML)@en[<[[a]] [[href]]>]] に指定された時はその[[閲覧文脈]]で評価されますし、
[CODE(HTML)@en[<[[iframe]] [[src]]>]] に指定された時はその [CODE(HTMLe)@en[[[iframe]]]]
の[[入れ子閲覧文脈]]で評価されます [SRC[>>35]]。
]EG]

[EG[
[59] 多くの [[Bookmarklet]] は、 [[navigate]] により他のページに遷移することを防ぐため、
最後に [CODE(JS)@en[[[void]]()]] を実行するなどして [[void]] を返すようにしています。
]EG]

[57] 
この手順は、 [[navigate]] から呼び出されます。
この手順が返した[VAR[応答]]は、
[[navigate応答の処理]]に回されます。


;; [63] この手順は、他の [[URL scheme]] なら [[fetch]] に相当するものです。
[[スクリプト]]を実行するという特別な性質から、 [CODE(URI)@en[[[javascript:]]]]
[[URL]] から [[HTTP応答]]を取得する処理は [[fetch]] ではなく [[navigate]]
の一部として規定されています。このため [[fetch]] が直接呼び出される場面
(例えば [CODE(HTML)@en[<[[img]] [[src]]>]]) では [CODE(URI)@en[[[javascript:]]]]
[[URL]] を使うことができません。歴史的にはそのような場面でも [[JavaScript]]
を実行していた [[Webブラウザー]]も存在していました。

* 歴史

[REFS[
- [34] [CITE@en[draft-hoehrmann-javascript-scheme - The 'javascript' resource identifier scheme]]
<http://tools.ietf.org/html/draft-hoehrmann-javascript-scheme>
- [27] [CITE@en-GB-x-Hixie[Web Forms 2.0]] ([TIME[2009-01-05 20:07:15 +09:00]] 版) <http://www.whatwg.org/specs/web-forms/current-work/#for-javascript>
]REFS]

[1]
''不思議な指定? javascript:'css〜'について'' <http://www.parkcity.ne.jp/~chaichan/qanda/qa5032.htm>

[CODE(URI)[javascript:]] scheme を
[CODE(URI)[[[data]]:]] や [CODE(URI)[[[about]]:]] のように使うという話です。 (このスレ自体はレベルが低くて参考にはなりません。)

[[Gecko]] も [[WinIE 6]] も、
ブラウザのアドレス欄に
<javascript:"<p>abcdefg</p>"> のように入れてみると、評価結果を [[HTML]] として処理することが分かります。 (がおそらくその辺は適宜判断で、件の掲示板のスレのように [[CSS]] として解釈させることもできるのでしょう。)

これ、使い方によっては security hole になりかねないので注意する必要がありそうです・・って、 [CODE(URI)[javascript:]]
scheme 自体 security hole だから問題は変わっていませんか。
([[名無しさん]] [WEAK[2004-05-09 03:54:16 +00:00]])

[2]
そういえば [CODE(URI)[javascript:]] scheme の仕様はやっぱり存在していないのか? Netscape の仕様書くらいはあるのか?

[3] >>2 [[JavaScript 1.3]] のマニュアルより:

[4] ''Additional Topics — Using JavaScript URLs'' <http://devedge.netscape.com/library/manuals/2000/javascript/1.3/guide/advtopic.html#1004952>

- [CODE(HTMLa)[[[href]]]] 値として [CODE(URI)[javascript:]]
URI を使うことができる。
- [CODE(URI)[javascript:]] の後には、どんな[[文]]や[[関数呼出]]でも書くことができる。
- 評価結果が未定義 (undefined) なら、新しい文書は読込まれない。
- 評価結果が定義された型なら、[[文字列]]に変換され、
読込む文書の source とする。

[5] ''JavaScript Security'' <http://devedge.netscape.com/library/manuals/2000/javascript/1.3/guide/sec.html>

- [CODE(URI)[javascript:]] URI は未署名と見なす。
署名する方法はない。

[6] <http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/location.html#1203002>

URI scheme の説明。得られる情報は >>4 の subset。

[7] ''Displaying Errors with the JavaScript Console — Opening the JavaScript Console'' <http://devedge.netscape.com/library/manuals/2000/javascript/1.3/guide/console.html#1044393>

- [CODE(URI)[javascript:]] だけだと、 JavaScript Console を開く。
- JavaScript Console は JavaScript 1.3+ の機能である。

[[JavaScript 1.5]] のマニュアルには [CODE(URI)[javascript:]]
URI についての言及はありませんでした。

[8] ''javascript Protocol (Internet Explorer - Asynchronous Pluggable Protocols)'' <http://msdn.microsoft.com/workshop/networking/predefined/javascript.asp>

- [CODE(URI)[javascript:]] の後には、一つ以上の JavaScript
文を記述します。
- [[WinIE 3.0]]+ で実装されています。

[9]
[[Web Forms 2.0]] が >>3-7 の JavaScript 1.3 の説明書を [CODE(URI)[javascript:]] の出典に選んでいます ([[DevEdge]] はなくなっちゃったけど)。
だから JS1.3 が一番まともな原典なのかも。

[[WHAT]] WG がいずれ [CODE(URI)[javascript:]] の仕様も作ってくれると期待するのも一つの手(?)かも。
([[名無しさん]])

[10]
関連する [[URI scheme]]: [CODE(URI)[[[ecmascript]]:]],
[CODE(URI)[[[livescript]]:]],
[CODE(URI)[[[mocha]]:]],
[CODE(URI)[[[data]]:]]
([[名無しさん]] [sage])

[11]
[[VRML]] における [CODE(URI)@en[javascript:]] [[URI scheme]]
の定義:
= [CITE[VRML97, ISO/IEC 14772-1:1997 -- Annex C, ECMAScript Scripting Reference]] <http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-IS-VRML97WithAmendment1/part1/javascript.html#Access>
= [CITE[VRML97, ISO/IEC 14772-1:1997 -- 4 Concepts]] <http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-IS-VRML97WithAmendment1/part1/concepts.html#4.5.4>

([[名無しさん]] [sage])

[12]
[CITE@en[Extensible 3D (X3D), ISO/IEC 19775-1:200x, Part 1 -- 9 Networking component]] 
<http://www.web3d.org/x3d/specifications/ISO-IEC-19775-IS-X3DAbstractSpecification/Part01/components/networking.html#ScriptingLanguageProtocols>

>>11 [[X3D]] における定義。 [CODE(URI)@en[javascript:]]
は非推奨になり、代わりに [CODE(URI)@en[[[ecmascript]]:]]
が用意されています。
([[名無しさん]] [sage])

[13]
>>12
[CITE@en[X3D Specification, ISO/IEC 19775-2:200x, Part 2, Annex A VRML97 Scripting Backwards Compatibility]] 
<http://www.web3d.org/x3d/specifications/ISO-IEC-19775-IS-X3DAbstractSpecification/Part02/vrml97.html#InlineScriptDefinition>

([[名無しさん]] [sage])

[14]
[CITE[JavaScript in CSS files]] <http://www.quirksmode.org/css/javascript.html>
([[名無しさん]])

[15]
[CITE@en[The 'javascript' resource identifier scheme]]
<urn:ietf:id:draft-hoehrmann-javascript-ri-00>
<http://www.websitedev.de/ietf/draft-hoehrmann-javascript-ri-00.txt>
<http://ietfreport.isoc.org/idref/draft-hoehrmann-javascript-ri/>

([[名無しさん]] [WEAK[2006-10-28 15:11:00 +00:00]])

[16]
[CITE[The 'javascript' scheme from Bjoern Hoehrmann on 2006-10-28 (uri@w3.org from October 2006)]] <http://www.w3.org/mid/nb66k29fqd915t8u7f3lsn6oj2ctj5og5t@hive.bjoern.hoehrmann.de>

([[名無しさん]] [WEAK[2006-10-28 15:19:14 +00:00]])

[17]
[CITE[The 'javascript' scheme from Bjoern Hoehrmann on 2006-10-28 (uri@w3.org from October 2006)]] <http://www.w3.org/mid/nb66k29fqd915t8u7f3lsn6oj2ctj5og5t@hive.bjoern.hoehrmann.de>

([[名無しさん]] [WEAK[2006-10-28 15:19:32 +00:00]])

[18]
[CITE[crisp’s blog &#187; Blog Archive &#187; The useless javascript: pseudo-protocol]] <http://therealcrisp.xs4all.nl/blog/2006/12/05/the-useless-javascript-pseudo-protocol/>
([[名無しさん]] [WEAK[2006-12-18 23:05:31 +00:00]])

[19]
[CITE@ja[Firefox 1.5 の怪しい [CODE(HTML)@en[href="javascript:"]] 処理]] ([[わかば]] 著, [CODE[2007-04-26 22:07:50 +09:00]] 版) <https://suika.suikawiki.org/~wakaba/d/d200704#d7-1>
([[名無しさん]] [WEAK[2007-06-03 14:38:45 +00:00]])


[22]
[CODE(URI)@en[[[javascript]]:]] [[URI]] が[[文字列]]を返した場合、
[[Firefox]] 1.5 は ([CODE(HTMLe)@en[[[a]]]] や [[URI]]
の直接指定なら) [CODE(MIME)@en[[[text/html]]]]
と解釈しますが、
[[Opera]] 9 は現在の[[文書]]と同じ[[媒体型]]とみなすようです。

例えば、 [CODE(MIME)@en[[[text/xml]]]] [[文書]]:
[PRE(HTML example code)[
...
<a href="javascript:'a'">link</a>
...
]PRE]

... のリンクをたどると、 [[Firefox]] は [Q[a]]
と表示しますが、 [[Opera]] は[[整形式]]でないといってきます。

;; <https://suika.suikawiki.org/~wakaba/-temp/test/html/link/href/javascript/>
の data-*

([[名無しさん]])

[23]
[CITE[seamonkey mozilla/dom/src/jsurl/]] ([TIME[2007-07-25 20:12:42 +09:00]] 版) <http://mxr.mozilla.org/seamonkey/source/dom/src/jsurl/>

[25]
[CITE[hoshikuzu | star_dust の書斎 - 2007-09-18]] ([CODE[2007-09-21 11:56:34 +09:00]] 版) <http://d.hatena.ne.jp/hoshikuzu/20070918#p1>
([[名無しさん]])


[26]
[CITE@en[javascript: URIs]] ([TIME[2008-06-27 21:14:33 +09:00]] 版) <https://suika.suikawiki.org/~wakaba/-temp/test/uri/javascript/test.cgi#>
([[名無しさん]])



[28] [CITE[JavaScriptを記述、実行を促す動画について‐ニコニコニュース]]
([TIME[2009-09-12 02:40:15 +09:00]] 版)
<http://blog.nicovideo.jp/niconews/2009/09/004642.html>

[29] [CITE['''['''whatwg''']''' Javascript: URLs as element attributes]]
([TIME[2010-11-16 10:22:12 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-November/029042.html>

[30] [CITE[Inline Images on Web Pages]]
( ([TIME[2005-10-31 14:52:43 +09:00]] 版))
<http://elf.org/essay/inline-image.html>

[31] [CITE[The whatwg December 2010 Archive by thread]]
( ([TIME[2010-12-02 22:51:02 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/thread.html>

[32] [CITE['''['''whatwg''']''' Javascript: URLs as element attributes]]
([TIME[2011-02-10 12:23:16 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-February/030360.html>

[33] [CITE@en[Web Applications 1.0 r6139     Drop javascript: support from <img src>, <object data>, CSS, etc, etc, etc.]]
( ([TIME[2011-05-14 07:34:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6138&to=6139>


[37] [CITE[Results for javascript: URL canonicalization (See <https://suika.suikawiki.org/www/url/perl-weburl/t/browsers/decomps.html?decomps-javascript.dat;compat>)]]
( ([TIME[2011-06-04 22:28:19 +09:00]] 版))
<https://suika.suikawiki.org/gate/test-results/list/url-canon-javascript-20110604/all>

[38] [CITE['''['''whatwg''']''' Javascript: URLs as element attributes]]
([TIME[2011-06-07 09:15:22 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-June/031940.html>

[39] [CITE[''''''[''''''whatwg'''''']'''''' URL: javascript URLs]]
( ([TIME[2012-09-28 11:45:50 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-September/037465.html>

[40] [CITE@en[URL schemes - WHATWG Wiki]]
( ([TIME[2012-12-03 10:54:13 +09:00]] 版))
<http://wiki.whatwg.org/wiki/URL_schemes>

[41] [CITE[Client-Side JavaScript Reference]]
( ([TIME[2011-02-10 00:16:32 +09:00]] 版))
<http://docs.oracle.com/cd/E19957-01/816-6408-10/location.htm#1193137>

[42] [CITE@en[Web Applications 1.0 r5865 Use 'javascript: scheme' instead of 'javascript: protocol'.]]
( ([TIME[2011-02-09 10:09:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5864&to=5865>

[43] [CITE@en[Web Applications 1.0 r2529        MAJOR CHANGES: Revamp the way scripts are specified, along with their interaction with resolving relative URLs, etc. Give enough detail to justify objects in the DOM not being garbage collected randomly when still in use. Define script groups, to handle scripts going away during document.open() and session history navigation. Define why and how setTimeout(), database transactions, etc, handle page transitions. Drop the terms 'with' and 'without' script, use script is 'enabled'/'disabled' instead. Define 'unload' and 'beforeunload'. Rework how onfoo='' and .onfoo event handler attributes are defined. Rework how the content model of <noscript> is defined. Reword the way javascript: is defined to use the new terminology. Add a few notes of things that came up while I was doing all that.]]
( ([TIME[2008-12-12 17:46:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=2528&to=2529>

[44] [CITE@en[Web Applications 1.0 r2683     Prevent cross-origin javascript: navigation of browsing contexts. Define the base URL and document's address of pages generated by javascript: URLs. Minor editorial tweaks.]]
( ([TIME[2009-01-21 09:58:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=2682&to=2683>

[45] [CITE@en[URL schemes - WHATWG Wiki]]
( ([TIME[2013-02-21 17:06:55 +09:00]] 版))
<http://wiki.whatwg.org/wiki/URL_schemes>

[46] [CITE@en[Bug 13720 – Define javascript: processing entirely inline, and make it only happen in the navigation algorithm; then, remove special-casing elsewhere, and make it non-conforming in those places]]
( ([TIME[2013-10-26 10:51:26 +09:00]] 版))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=13720>

[70] [CODE(URI)@en[[[javascript:]]]] [[URL]] の処理は [[HTML Standard]]
で規定されるようになりました。しかし処理方法だけで、意味と構文の規定は行われていません。

[71] [[WHATWG Wiki]] のページ (>>45) は、 [CODE(URI)@en[[[javascript:]]]]
[[URL]] の意味を規定する、実質的な仕様書となっています。 [[I-D]] (>>15)
を[[廃止]]するものである [SRC[>>45]] と述べられています。

[47] [CITE[IRC logs: freenode / #whatwg / 20131107]]
( ([TIME[2013-11-09 12:27:06 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20131107#l-781>

[48] [CITE@en[Web Applications 1.0 r8285     Define the task settings for the javascript: task]]
( ([TIME[2013-11-16 01:18:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8284&to=8285>

[49] [CITE@en[Web Applications 1.0 r8284     Move javascript: processing entirely into HTML, and fix its definitions to match reality better at the same time.]]
( ([TIME[2013-11-16 00:56:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8283&to=8284>

[50] [CITE[IRC logs: freenode / #whatwg / 20131115]]
( ([TIME[2013-11-17 11:47:01 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20131115>

[51] [CITE@en[Web Applications 1.0 r2046 Require that <script src=javascript:...></script> result in no script execution, for any value of '...', for compatibility with most UAs.]]
([TIME[2008-08-11 19:14:00 +09:00]] 版)
<https://html5.org/r/2046>

* 関連

[62] かつて [[IE]] 向けに[[イベントハンドラー内容属性]]の先頭に
[CODE[javascript:]] と書くことで [[JavaScript]] であると明示する構文がありましたが、
これは [[URL]] ではありません。


[64] [CITE[Part2 - browsersec - Browser Security Handbook, part 2 - Browser Security Handbook - Google Project Hosting]]
([TIME[2015-03-31 16:42:55 +09:00]] 版)
<https://code.google.com/p/browsersec/wiki/Part2#URL_scheme_access_rules>

[72] [CITE@en[Location Hack does not work · Issue #2232 · greasemonkey/greasemonkey]]
([TIME[2015-08-15 11:40:28 +09:00]] 版)
<https://github.com/greasemonkey/greasemonkey/issues/2232>

[73] [CITE@en[1192821 – Regression: 39.0.3: Greasemonkey's "Location hack" no longer works]]
([TIME[2015-08-15 11:40:55 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=1192821>

[74] [CITE@en[Location hack - GreaseSpot Wiki]]
([TIME[2014-11-29 08:19:01 +09:00]] 版)
<http://wiki.greasespot.net/Location_hack>

[75] [CITE@en[Integrate Fetch into HTML · whatwg/html@7c5555a]]
([TIME[2015-09-18 19:20:09 +09:00]] 版)
<https://github.com/whatwg/html/commit/7c5555a16f2920c02244c10756bb2f1a11e87a22>

[76] [CITE@en[Rewrite script execution on top of ES · whatwg/html@4891d18]]
([TIME[2015-12-22 18:58:20 +09:00]] 版)
<https://github.com/whatwg/html/commit/4891d18aaf2df1d40aa61f467a5a10cfc19dd85d>

[77] [CITE@en[Add <script type="module"> and module resolution/fetching/evaluation · whatwg/html@cd1a9fb]]
([TIME[2016-01-21 22:26:21 +09:00]] 版)
<https://github.com/whatwg/html/commit/cd1a9fb1e83f7d0bc30be8b34ecdaf444a0b19a4>

[83] [CITE@en[Fix javascript: URL script execution · whatwg/html@6412172]]
([TIME[2016-04-16 15:27:25 +09:00]] 版)
<https://github.com/whatwg/html/commit/64121722be80ca4e0ea426a085b5fb1a971303cb>

[84] [CITE@en[Detail how javascript: return values become response bodies · whatwg/html@9997cd9]]
([TIME[2016-04-27 16:24:42 +09:00]] 版)
<https://github.com/whatwg/html/commit/9997cd93c65a9f4a640a593c02f01c2c58924457>

[86] [CITE@en[Integrate with the Referrer Policy spec, part 2 of n]]
( ([[domenic]]著, [TIME[2016-05-18 01:52:35 +09:00]]))
<https://github.com/whatwg/html/commit/176e74243c649b709b9959b7d08b327290c2f403>

[87] [CITE@en[Get origin from a browsing context's active document]]
( ([[annevk]]著, [TIME[2016-05-30 21:04:25 +09:00]]))
<https://github.com/whatwg/html/commit/d727bf9335f32ab87109658d8e83b0ee3c2866bf>

[88] [CITE@en[Extract bits out of a javascript URL through serialization]]
( ([[annevk]]著, [TIME[2016-06-01 16:41:51 +09:00]]))
<https://github.com/whatwg/html/commit/4113965994bb5d0c650bae13f28883d525a34002>

[89] [CITE@en[Fix javascript: URL example explanation]]
( ([[domenic]]著, [TIME[2016-06-16 15:05:37 +09:00]]))
<https://github.com/whatwg/html/commit/cdf82d5def226004bb90479c284c22e329a4edbd>

[90] [CITE@en[Navigate: remove "gone async" and define redirect handling]]
([[annevk]]著, [TIME[2016-07-04 17:38:20 +09:00]])
<https://github.com/whatwg/html/commit/8b630f5e4fa2ec8b0999470d09490bffe6e9a1e3>

[91] [CITE@en[Navigate: minor javascript URL fixup]]
([[annevk]]著, [TIME[2016-07-08 02:02:03 +09:00]])
<https://github.com/whatwg/html/commit/8f34fc491631f5e940d50950567a4cecee104eec>

[92] [CITE@en[Handle navigation to `javascript:` URLs as inline script. (#142)]]
([[@bzbarsky]]著, [TIME[2016-11-10 17:07:39 +09:00]])
<https://github.com/w3c/webappsec-csp/commit/479bf6c6e891db0bb1cd7f71be764f3aff6a1a33>

[93] [CITE@en[Apply CSP to javascript URLs in navigate]]
([[mikewest]]著, [TIME[2016-11-14 19:14:58 +09:00]])
<https://github.com/whatwg/html/commit/9daeebfbdd068357257fcb69486d47a893c36f63>

[96] [CITE@en[Remove javascript URL case from <a>/<area>/Location hash setter]]
([[annevk]]著, [TIME[2017-02-22 15:19:37 +09:00]])
<https://github.com/whatwg/html/commit/deea9fba916cb6e66c7dcfc57442cf25ac0441a1>

[97] [CITE@en[Remove javascript URL special case from the API]]
([[annevk]]著, [TIME[2017-02-16 22:57:09 +09:00]])
<https://github.com/whatwg/url/commit/4bf85a08da18ef367e093426abef776d59e8fb7b>

[98] [CITE@en[Editorial: move base URL from "module script" to "script"]]
([[domenic]]著, [TIME[2017-09-14 20:28:50 +09:00]])
<https://github.com/whatwg/html/commit/5458513792ab00d58e6c91ba48faaa611d034a2e>

[99] [CITE@en[Make integrity="" work on module scripts]]
([[domenic]]著, [TIME[2017-09-14 18:00:24 +09:00]])
<https://github.com/whatwg/html/commit/9275d955dcd604e959cfcc672e0c234b1b8c00db>

[100] [CITE@en[Clarify navigation behavior for 'script-src'.]]
([[mikewest]]著, [TIME[2017-12-21 18:28:45 +09:00]])
<https://github.com/w3c/webappsec-csp/commit/7a4577c7975c8afdac0c0fc5a5493059b5660742>

[101] [CITE@en[Do not use percent decode on strings]]
([[annevk]]著, [TIME[2017-10-10 21:54:23 +09:00]])
<https://github.com/whatwg/html/commit/ce8404fa5d8c2c91725c5262fd69d0d45c227ec8>

[102] [CITE@en[Do not use percent decode on strings by annevk · Pull Request #3111 · whatwg/html]]
([TIME[2018-05-25 01:08:50 +09:00]])
<https://github.com/whatwg/html/pull/3111>

[103] [CITE@en[Return the completion record result from running a script]]
([[mattto]]著, [TIME[2018-08-11 03:18:45 +09:00]])
<https://github.com/whatwg/html/commit/ad3dda51552aeeeea60540c7f1b513fe45b486a5>

[108] [CITE@en[Return the completion record result from running a script. by mattto · Pull Request #3888 · whatwg/html]]
([TIME[2018-08-14 23:44:40 +09:00]])
<https://github.com/whatwg/html/pull/3888>

[109] [CITE@en[Return empty on "do not run" for running a script]]
([[mattto]]著, [TIME[2018-08-15 01:31:40 +09:00]])
<https://github.com/whatwg/html/commit/b71f885ec4f6e1a074157036d3deb9f1d6a9aa77>

[110] [CITE@en[Return empty on "do not run" for running a script. by mattto · Pull Request #3907 · whatwg/html]]
([TIME[2018-08-18 23:55:09 +09:00]])
<https://github.com/whatwg/html/pull/3907>

[111] [CITE@en[Remove overridden reload concept]]
([[TimothyGu]]著, [TIME[2018-08-18 05:31:49 +09:00]])
<https://github.com/whatwg/html/commit/6440ccae7340ea41d3eb5bf8ff0b3b27363eda85>

[65] [CITE@en[Do not use percent decode on strings]]
([[annevk]]著, [TIME[2017-10-10 21:54:23 +09:00]])
<https://github.com/whatwg/html/commit/ce8404fa5d8c2c91725c5262fd69d0d45c227ec8>

[112] [CITE@en[Added javascript: scheme specifically and fixed a small comment (#370)]]
([[andypaicu]]著, [TIME[2018-12-01 21:54:35 +09:00]])
<https://github.com/w3c/webappsec-csp/commit/0ab98b910f2953161ad4208042694705b0faddde>

[113] [CITE@en[Added javascript: scheme specifically and fixed a small comment by andypaicu · Pull Request #370 · w3c/webappsec-csp]]
([TIME[2019-05-31 15:09:13 +09:00]])
<https://github.com/w3c/webappsec-csp/pull/370>

[114] [CITE@en[Make CSP inheritance for javascript: more explicit · Issue #368 · w3c/webappsec-csp]]
([TIME[2019-05-31 15:09:23 +09:00]])
<https://github.com/w3c/webappsec-csp/issues/368>

[115] [CITE@en[Specify a navigated-to new document's URL]]
([[jyasskin]]著, [TIME[2018-12-19 07:43:57 +09:00]])
<https://github.com/whatwg/html/commit/f2c7ea37eed6346affa6f8d336eb63173e39ac45>

[117] [CITE@en[Consider not special casing document's address handling when loading javascript: · Issue #1565 · whatwg/html]]
([TIME[2019-06-01 11:33:42 +09:00]])
<https://github.com/whatwg/html/issues/1565>

[118] [CITE@en[Specify a new document's URL by jyasskin · Pull Request #4205 · whatwg/html]]
([TIME[2019-06-01 11:34:34 +09:00]])
<https://github.com/whatwg/html/pull/4205>

[FIG(quote)[
[FIGCAPTION[
[119] [CITE[VRML97, ISO/IEC 14772-1:1997 -- 4 Concepts]]
([TIME[2014-01-31 07:20:50 +09:00]])
<https://www.web3d.org/documents/specifications/14772/V2.0/part1/concepts.html#4.5.4>
]FIGCAPTION]

> The Script node's url field may also support custom protocols for the various scripting languages. For example, a script url prefixed with javascript: shall contain ECMAScript source, with line terminators allowed in the string. The details of each language protocol are defined in the annex for each language. Browsers are not required to support any specific scripting language. However, browsers shall adhere to the protocol defined in the corresponding annex of ISO/IEC 14772 for any scripting language which is supported. 

]FIG]


[66] [CITE@en[Editorial: factor out and clean up javascript: URL processing]]
([[domenic]]著, [TIME[2019-02-28 03:55:35 +09:00]])
<https://github.com/whatwg/html/commit/e13762fb626dfd64e7639b79cb61a766d66bd72f>

[78] [CITE@en[Editorial: factor out and clean up javascript: URL processing by domenic · Pull Request #4396 · whatwg/html]]
([TIME[2020-09-19 18:42:14 +09:00]])
<https://github.com/whatwg/html/pull/4396>

[79] [CITE@en[Fix document URL setting for javascript: URLs]]
([[TimothyGu]]著, [TIME[2019-07-06 04:11:39 +09:00]])
<https://github.com/whatwg/html/commit/06aa2d682b731e5ebc72169c63744e8608418dd8>

[82] [CITE@en[Fix document URL setting for javascript: URLs by TimothyGu · Pull Request #4698 · whatwg/html]]
([TIME[2020-09-19 19:15:21 +09:00]])
<https://github.com/whatwg/html/pull/4698>

[125] [CITE@ja[Googleがonclickにはhref="javascript:void(0)"も付ける理由? | 指向性メモ - 技術]], [TIME[2022-06-11T03:38:26.000Z]], [TIME[2022-06-13T05:16:43.587Z]] <https://yudai.arielworks.com/memo/2006/06/24/185137>

[95] [CITE@ja[フォーカスとjavascript:void(0)の話・2 | 指向性メモ - [[技術]]]], [TIME[2022-06-11T03:38:26.000Z]], [TIME[2022-06-13T05:09:37.663Z]] <https://yudai.arielworks.com/memo/2006/06/30/151521>

[124] 
この時代の一部の人々 ([[Web 1.0]] 時代に学んだ人々) はまだ
[[HTML文書]]が[[Webアプリケーション]]であることに抵抗を持ってて、
[[JavaScript]] を使ったものを [[HTML]] として相応しくないと判断しがちなところあるよね。
この記事で引用されてるコメントの人々も、なんかよくわからない理屈で嫌がっている。
具体的な実装にも言及しているものの、
「これは避けるべき悪習」
「リンクとして機能させる気がない」
とか根幹には何かの理想像的なものがあって、それと現実を比べてる。
理解しがたい理屈だけど平成10年代前半くらいから見ればそう特異でもない考え方だったんだよね。
(この記事が書かれた頃は [[Ajax]] が普通になりつつあって、価値観の相転移が起こっていた。)



