Skip to content

Use shadow DOM instead of an iframe to encapsulate CSS #416

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kimlai
Copy link

@kimlai kimlai commented Jan 17, 2021

Fix #161

The problem: the widget uses an iframe to encapsulate its CSS and prevent leaking it to the projects using the widget (and vice versa). But since the iframe has a src attribute with the value about:blank, password managers do not work properly (they refuse to set a password without a corresponding url).

The solution: as suggested by this comment #161 (comment), this commit replaces the iframe by a shadow DOM element, which still encapsulates the modal CSS, but lets password managers do their thing (confirmed on Firefox 84.0.2).

Fix netlify#161

The problem: the widget uses an iframe to encapsulate its CSS and
prevent leaking it to the projects using the widget (and vice versa).
But since the iframe has a `src` attribute with the value `about:blank`,
password managers do not work properly (they refuse to set a password
without a corresponding url).

The solution: as suggested by this comment netlify#161 (comment),
this commit replaces the iframe by a shadow DOM element, which still
encapsulates the modal CSS, but lets password managers do their thing
(confirmed on Firefox 84.0.2).
@@ -253,7 +256,6 @@
.btnClose::before {
content: "×";
font-size: 25px;
line-height: 9px;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why, but I had to remove this so that the X was centered.

@netlify
Copy link

netlify bot commented Jan 17, 2021

✔️ Deploy Success!

🔨 Explore the source changes: 24be5db

🔍 Inspect the deploy logs: https://app.netlify.com/sites/identity/deploys/600420a924de790008388612

😎 Browse the preview: https://deploy-preview-416--identity.netlify.app

@siamkreative
Copy link

Using the Preview Deploy link, I tried to fill out the credentials using Bitwarden, but it still does not work.

Copy link

@relisora relisora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's my first time reviewing a PR, the code looks good to me and the preview link works well with chrome manager. Maybe it'll help keep the PR alive

@reyemtm
Copy link

reyemtm commented Apr 7, 2022

What's holding this up? The iframe method is not ideal as I had issues with a netlify site that itself was in an iframe and the password widget, so I am guess the iframe identity method would also not work in an embedded page though I have not tested. I just tested the preview deploy and was able to put in my saved credentials in Chrome on mobile.

@mashdot
Copy link

mashdot commented Mar 5, 2023

Afternoon, is there any move on this? Seems pretty odd that we still can't have browsers autofill credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firefox and Chrome not picking up password field (for auto-filling)
5 participants