Presence of an Webextension makes the head element missing on (iframe) load



2 years ago
8 months ago


(Reporter: jan, Unassigned)


55 Branch

Firefox Tracking Flags

(Not tracked)




2 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/58.0.3029.110 Chrome/58.0.3029.110 Safari/537.36

Steps to reproduce:

Use FF 55.0b3 (64-bit) or a recent Nightly.

Go to 

and see the site being looking like this:

Then install a WebExtension (either Tampermonkey[1] or Bitwarden [2]) and reload the page and see that it looks like this:

I've debugged the problem and it looks like the head element is missing when jQuery(iframe).on('load') fires.
You can double-check this by adding a conditional breakpoint 

console.log('after', head);

at line 31710 of the script

The issue can be fixed by either adding this conditional breakpoint:

console.log('before', $(iframeDoc).find('head')); for (var i=0;i<1000000;ii+) {};

one line above (31709) or disabling the WebExtension.




2 years ago
Summary: Presence of an Webextensions make the head element missing on (iframe) load → Presence of an Webextension makes the head element missing on (iframe) load

Comment 1

2 years ago
> The issue can be fixed by either adding this conditional breakpoint:
...or simply a unconditional breakpoint

Comment 2

2 years ago
If this is a web extension specific problem + iframe, maybe it has something to do with content scripts with all_frames = true?
Component: Untriaged → WebExtensions: Untriaged
Ever confirmed: true
Product: Firefox → Toolkit


2 years ago
Priority: -- → P3

Comment 3

2 years ago
I've been able to reproduce this on Nightly using a content script which has both "all_frames": true and "run_at": "document_start". 

I've the feeling that it could be related to (or even a duplicate of) Bug 1379148, because that website provides an embedded livepreview feature, and so it is very likely that this website is trying to change the content of an iframe while the iframe document loading has been paused by the content script which needs to run at document_start, but I didn't need to set "match_about_blank" to true to be able to reproduce this issue).

The issue can be reproduced even with an empty content script (which is also an additional clue that this issue impacts on websites that is changing the content of one of its iframe while the document has been paused because of a document_start content_script)
See Also: → 1379148


10 months ago
Product: Toolkit → WebExtensions


10 months ago

Comment 4

10 months ago
Hmm, I didn't knowingly make that change of status, I had a problem with the browser when attempting to submit a comment (and found the change of status after submission failed). 

Is this reproducible with Firefox ESR 60.1 or Firefox 61?
Bulk move of bugs per
Component: Untriaged → General
You need to log in before you can comment on or make changes to this bug.