A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/ja/docs/Web/API/HTMLScriptElement/attributionSrc below:

HTMLScriptElement: attributionSrc プãƒãƒ‘ティ - Web API

HTMLScriptElement: attributionSrc プロパティ

Limited availability

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

attributionSrc は HTMLScriptElement インターフェイスのプロパティで、<script> 要素の attributionsrc 属性をプログラムで取得・設定し、その属性値を反映します。attributionsrc はブラウザーにスクリプトリソースリクエストと一緒に Attribution-Reporting-Eligible ヘッダーを送信することを指定します。

サーバー側では、これはレスポンスで Attribution-Reporting-Register-Source または Attribution-Reporting-Register-Trigger ヘッダーを送信するトリガーとして用いられ、それぞれ JavaScript ベースの帰属ソースまたは帰属トリガーを登録します。どのレスポンスヘッダーを送り返すべきかは、登録を行った Attribution-Reporting-Eligible ヘッダーの値に依存します。

メモ: 他にも、JavaScript の帰属ソースまたはトリガーは、fetch() リクエストに attributionReporting オプションをつけて送信するか(fetch() 呼び出しで直接設定するか、fetch() 呼び出しに渡された Request オブジェクトで)、XMLHttpRequest で setAttributionReporting() をリクエストオブジェクトについて呼び出したりすることもできます。

詳細は属性レポート API です。

値

文字列です。このプロパティには 2 つのバージョンがあり、取得したり設定したりすることができます。

例 空の attributionSrc を設定
<script src="advertising-script.js"></script>
const scriptElem = document.querySelector("script");
scriptElem.attributionSrc = "";
attributionSrc に URL を設定
<script src="advertising-script.js"></script>
// URL に '=' のような特殊文字が格納されていると不適切に解釈されてしまうため、
// エンコードしてください。
const encodedUrlA = encodeURIComponent("https://a.example/register-source");
const encodedUrlB = encodeURIComponent("https://b.example/register-source");

const scriptElem = document.querySelector("script");
scriptElem.attributionSrc = `${encodedUrlA} ${encodedUrlB}`;
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4