-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forcing all iframes to be credentialless / dealing with iframes created by external scripts #14
Comments
Hi @benediktwerner ! Historically, this was the original idea: Bundling everything behind The second problem was about how to define the behavior of iframe.credentialess. Its implementation is totally different from Iframe.credentialless was developed after COEP:credentialless. An attribute was added. It got renamed several times: <iframe crossorigin="anonymous"></iframe> <!-- original -->
<iframe anonymous></iframe> <!-- V2 -->
<iframe credentialless></iframe> <!-- V3 --> Adding a way to configure the default behavior globally could be done easily. The real difficulty is getting a sufficiently strong interested from web-developers and browser vendors. The real difficulty is getting a consensus. In the meantime, some solution/hack could be used:
Polyfill const originalCreateElement = document.createElement;
document.createElement = function() {
const element = originalCreateElement.apply(this, arguments);
if (element instanceof HTMLIFrameElement) {
element.credentialless = true;
}
return element;
} |
Thanks for the detailed response! The polyfill seems like a reasonable enough solution I hadn't considered. I still would love to see a way to have a global default and potentially disable it per iframe with an attribute to also avoid having to specify it on all iframes (and potentially forgetting it somewhere) but yeah, I understand that the interest from devs and browser vendors isn't that large currently. I'm already quite happy about the attribute in Chrome and that Firefox seems to be moving forward with COEP:credentialless. |
Not sure if this is the right place to post this but I ran into the following issue trying to use the
credentialless
attribute with Twitter tweet embeds:The iframes in this case are created by an external script (https://platform.twitter.com/widgets.js) which of course doesn't add the
credentialless
attribute. There is an event mechanism to run code when a tweet is rendered but it only triggers after the tweet is added to the DOM which appears to be too late.I guess one kinda ugly workaround would be to do the tweet embedding inside a
credentialless
iframe but that's not really a great solution.Ideally, there would be some way to say "please make all iframes
credentialless
", presumably via an HTTP header. This also would solve the issue of having to add the attribute to all iframes.The text was updated successfully, but these errors were encountered: