diff options
Diffstat (limited to 'files/ja/web/http/headers/content-security-policy/worker-src/index.html')
-rw-r--r-- | files/ja/web/http/headers/content-security-policy/worker-src/index.html | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/files/ja/web/http/headers/content-security-policy/worker-src/index.html b/files/ja/web/http/headers/content-security-policy/worker-src/index.html new file mode 100644 index 0000000000..2164488eee --- /dev/null +++ b/files/ja/web/http/headers/content-security-policy/worker-src/index.html @@ -0,0 +1,97 @@ +--- +title: 'CSP: worker-src' +slug: Web/HTTP/Headers/Content-Security-Policy/worker-src +tags: + - CSP + - HTTP + - セキュリティ + - ディレクティブ + - リファレンス +translation_of: Web/HTTP/Headers/Content-Security-Policy/worker-src +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP の {{HTTPHeader("Content-Security-Policy")}} (CSP) <code><strong>worker-src</strong></code> ディレクティブは、 {{domxref("Worker")}}, {{domxref("SharedWorker")}}, {{domxref("ServiceWorker")}} スクリプトの有効なソースを指定します。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">CSP バージョン</th> + <td>3</td> + </tr> + <tr> + <th scope="row">ディレクティブ種別</th> + <td>{{Glossary("Fetch directive", "フェッチディレクティブ")}}</td> + </tr> + <tr> + <th scope="row">フォールバック</th> + <td> + <p>このディレクティブがない場合、ユーザーエージェントはワーカーの実行の管理のために、最初に {{CSP("child-src")}} ディレクティブ、次に {{CSP("script-src")}} ディレクティブ、最後に {{CSP("default-src")}} ディレクティブを探します。</p> + + <p>Chrome 59 以降は {{CSP("child-src")}} ディレクティブを飛ばします。</p> + + <p>Edge 17 は {{CSP("script-src")}} ディレクティブを飛ばします (<a href="https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17415478/">bug</a>)。</p> + </td> + </tr> + </tbody> +</table> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<p><code>worker-src</code> ポリシーには1つ以上のソースを指定することができます。</p> + +<pre class="syntaxbox">Content-Security-Policy: worker-src <source>; +Content-Security-Policy: worker-src <source> <source>; +</pre> + +<h3 id="Sources" name="Sources">ソース</h3> + +<p>{{page("Web/HTTP/Headers/Content-Security-Policy/default-src", "Sources")}}</p> + +<h2 id="Examples" name="Examples">例</h2> + +<h3 id="Violation_cases" name="Violation_cases">違反の場合</h3> + +<p>この CSP ヘッダーが与えられている時、</p> + +<pre class="brush: bash">Content-Security-Policy: worker-src https://example.com/</pre> + +<p>{{domxref("Worker")}}, {{domxref("SharedWorker")}}, {{domxref("ServiceWorker")}} はブロックされ、読み込まれません。</p> + +<pre class="brush: html"><script> + var blockedWorker = new Worker("data:application/javascript,..."); + blockedWorker = new SharedWorker("https://not-example.com/"); + navigator.serviceWorker.register('https://not-example.com/sw.js'); +</script></pre> + +<h2 id="Specifications" name="Specifications">仕様書</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様書</th> + <th scope="col">状態</th> + <th scope="col">備考</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{specName("CSP 3.0", "#directive-worker-src", "worker-src")}}</td> + <td>{{Spec2('CSP 3.0')}}</td> + <td>初回定義。</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> + +<p class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力したいのであれば、 <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</p> + +<p>{{Compat("http.headers.csp.worker-src")}}</p> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>{{HTTPHeader("Content-Security-Policy")}}</li> + <li>{{domxref("Worker")}}, {{domxref("SharedWorker")}}, {{domxref("ServiceWorker")}}</li> +</ul> |