HTMLIFrameElement: credentialless property - Web APIs | MDN
Value
A boolean. The default value is false; set it to true to make the <iframe> credentialless.
Examples
Get
Specify a credentialless <iframe> like so:
html
<iframe
src="https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)"
title="Spectre vulnerability Wikipedia page"
width="960"
height="600"
credentialless></iframe>
Return the credentialless property value:
js
const iframeElem = document.querySelector("iframe");
console.log(iframeElem.credentialless); // will return true in supporting browsers
Set
Alternatively, specify the minimum of details in the HTML:
html
<iframe width="960" height="600"> </iframe>
And set credentialless to true then load the <iframe> contents via script:
js
const iframeElem = document.querySelector("iframe");
iframeElem.credentialless = true;
iframeElem.title = "Spectre vulnerability Wikipedia page";
iframeElem.src =
"https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)";
Specifications
| Specification |
|---|
| Iframe credentialless # dom-htmliframeelement-credentialless |