Iframe content doesn't update after refresh when using src="data:text/html"
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
People
(Reporter: kontakt, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
|
99.60 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0
Steps to reproduce:
Create an html document file with the following iframe:
<iframe
sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"
src="data:text/html;charset=UTF-8,A"
></iframe>
Open it in Firefox. It displays the iframe with the capital letter A inside of it.
Then, go back to editing the html document in your IDE and change the iframe's src to "data:text/html;charset=UTF-8,B".
Go back to Firefox and press Reload
Actual results:
The contents of the iframe didn't change. - it still displays the letter A.
The Inspector shows the src attribute as updated, but the contents of the iframe are still outdated
Expected results:
The iframe contents should update
| Reporter | ||
Comment 1•2 years ago
|
||
The same happens if you use srcdoc instead of src
Comment 2•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Editor' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Reporter | ||
Comment 3•2 years ago
|
||
The sandbox attributes are irrelevant - you can reproduce it just as well with first loading a document with
<iframe srcdoc="A"></iframe>
and then changing the source document to
<iframe srcdoc="B"></iframe>
And then reloading the page in Firefox
Updated•2 years ago
|
Comment 4•2 years ago
|
||
I can reproduce the behavior as described (using a local file), though I'm not sure it is a valid issue. I assume the problem is that we're hitting the networking cache, so I'm going to move it there.
If you hold "shift" when you reload, then the page updates appropriately. This works whether you are clicking on the reload button or using the shortcut (so, it would be shift-command-R on Mac OS for instance).
I reproduced the same locally, but file and data URLs aren't cached at the networking level.
Looking around I found bug 527897, which seemed related.
Looking at the code in bug 527897 comment 0, it referenced the code in nsDocShell::MaybeHandleSubframeHistory.
If I make this method always return false, the bug goes away, so I think that's a good place to start.
Comment 6•2 years ago
|
||
Thanks for taking a look.
I'll mark this S3 because the force reload workaround does exist.
Description
•