Stylus: Firefox: cannot style programmatically created same-origin iframe

Created on 19 Oct 2017  路  3Comments  路  Source: openstyles/stylus

  • Browser: Firefox Developer Edition 57.0b9 (64-bit)
  • Operating System: Windows 10 Pro 1709
  • Screenshot:
    Image of a Twitter widget surrounded by a pink background. The widget itself does not have any pink backgrounds.
    (https://dev.twitter.com/web/overview)
  • Style:
* {
    background-color: pink !important;
}
Applies to: Everything

I checked #193, but this seems distinct since the style is correctly applied to the <iframe> on https://userstyles.org/help. The script responsible for <iframe> creation seems to be https://platform.twitter.com/widgets.js, but I don't know how it works in detail.

external

Most helpful comment

All 3 comments

Works correctly in Chrome.
Firefox doesn't inject any WebExtension content scripts in such iframes when the page is loading so evidently there's a bug in FF. I see no way to circumvent it without falling back to our old slow approach of using MutationObserver to monitor all iframe elements recursively. Since I'm not using FF I'm reluctant to do it, and would rather mozilla fix their browser.

Test version that uses tabs.insertCSS everywhere in FF [edit: updated the link] fixes the issue.
Needs testing with style updates, editing, basically everything. See temporary installation article.

Was this page helpful?
0 / 5 - 0 ratings