A RetroSearch Logo

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

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/HTMLAnchorElement/attributionSrc below:

HTMLAnchorElement: attributionSrc property - Web APIs

HTMLAnchorElement: attributionSrc property

Limited availability

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The attributionSrc property of the HTMLAnchorElement interface gets and sets the attributionsrc attribute on an <a> element programmatically, reflecting the value of that attribute. attributionsrc specifies that you want the browser to send an Attribution-Reporting-Eligible header. On the server-side this is used to trigger sending an Attribution-Reporting-Register-Source header in the response, to register of a navigation-based attribution source.

The browser stores the source data associated with the navigation-based attribution source (as provided in the Attribution-Reporting-Register-Source response header) when it receives the navigation response.

See the Attribution Reporting API for more details.

Note: <a> elements cannot be used as attribution triggers, only sources.

Value

A string. There are two versions of this property that you can get and set:

Examples Setting an empty attributionSrc
<a href="https://shop.example"> Click to visit our shop </a>
const aElem = document.querySelector("a");
aElem.attributionSrc = "";
Setting an attributionSrc containing URLs
<a href="https://ourshop.example"> Click to visit our shop </a>
// encode the URLs in case they contain special characters
// such as '=' that would be improperly parsed.
const encodedUrlA = encodeURIComponent("https://a.example/register-source");
const encodedUrlB = encodeURIComponent("https://b.example/register-source");

const aElem = document.querySelector("a");
aElem.attributionSrc = `${encodedUrlA} ${encodedUrlB}`;
Specifications Browser compatibility See also

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