files/en-us/web/api/htmliframeelement/browsingtopics/index.md
{{APIRef("HTML DOM")}}{{non-standard_header}}{{deprecated_header}}
[!WARNING] This feature is currently opposed by two browser vendors. See the Standards positions section for details of opposition.
The browsingTopics property of the {{domxref("HTMLIFrameElement")}} interface is a boolean specifying that the selected topics for the current user should be sent with the request for the associated {{htmlelement("iframe")}}'s source in a {{httpheader("Sec-Browsing-Topics")}} header. This reflects the browsingtopics HTML attribute.
See Using the Topics API for more details.
A boolean. The default value is false; set it to true to send the associated <iframe> source request with a {{httpheader("Sec-Browsing-Topics")}} header containing the selected topics for the current user.
Set browsingtopics to true then load the <iframe> contents declaratively:
<iframe browsingtopics title="Advertising container" src="ad-tech1.example">
...
</iframe>
Log the browsingTopics value via script:
const iframeElem = document.querySelector("iframe");
console.log(iframeElem.browsingTopics); // will return true in supporting browsers
Specify a minimum <iframe>:
<iframe> ... </iframe>
Set browsingtopics to true then load the <iframe> contents via script:
const iframeElem = document.querySelector("iframe");
iframeElem.browsingTopics = true;
iframeElem.title = "Advertising container";
iframeElem.src = "ad-tech1.example";
This feature is not part of an official standard, although it is specified in the Topics API Unofficial Proposal Draft.
{{Compat}}