Skip to content

Conversation

@lumynou5
Copy link
Contributor

@lumynou5 lumynou5 commented Sep 3, 2025

No description provided.

MATCH
[dark]

IFRAME
Copy link
Member

Choose a reason for hiding this comment

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

Could you please tell if this is necessary? If it's for the studio subdomain only, maybe it's worth moving it to a separate section?

Copy link
Contributor Author

@lumynou5 lumynou5 Sep 3, 2025

Choose a reason for hiding this comment

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

I found that embeded live chat (www.youtube.com domain) is not detected as expected if you turn off and on Dark Reader.

Though I didn't find out why Dark Reader doesn't mis-enable without restarting, it behaves correctly if it's not an iframe. Therefore, I thought the reason is something stops the detection (I initially thought it's the mismatched domain), and then I found

const detectDarkTheme = (
settings.detectDarkTheme &&
(isTopFrame || detectorHints?.some((h) => h.iframe)) &&
!isURLInList(tabURL, settings.enabledFor) &&
!isPDF(tabURL)
);

If the hint doesn't allow iframes, the detector is not run on iframes:

if (detectDarkTheme) {
runDarkThemeDetector((hasDarkTheme) => {
if (hasDarkTheme) {
removeDynamicTheme();
onDarkThemeDetected();
}
}, detectorHints);
}

See also: #10765

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did I understand the code correctly?

Copy link
Member

Choose a reason for hiding this comment

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

Dark theme is usually detected on root frames. But some websites use fullscreen iframes, that's why this IFRAME is needed. Could you please share a screenshon without a fix, so that I better understand the context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Expected:
the live chat is normal

Actual:
the live chat is dark-ized

@lumynou5 lumynou5 requested a review from alexanderby October 7, 2025 10:39
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.

2 participants