Open
Bug 1418712
Opened 7 years ago
Updated 4 years ago
IMG element not reloading image after Javascript .src call
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
NEW
People
(Reporter: lucianoaibar, Unassigned)
References
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Steps to reproduce:
HTML:
<img id="camara" src="https://www.madariaga.com.ar/img/camaras/informatica.jpg" />
JS:
document.getElementById('camara').src = 'https://www.madariaga.com.ar/img/camaras/informatica.jpg';
Actual results:
Executing the JS does nothing. Not reloading the image (the URI is the same).
Expected results:
Every time the that JS code is executed, the image must be reloaded.
The image sends all the not-to-cache headers.
Live example:
https://www.madariaga.com.ar/?q=camaras-en-vivo
works fine in other versions of Firefox, not working in latest 57.
Reporter | ||
Updated•7 years ago
|
Summary: IMG element, src element ignoring not to cache headers → IMG element not reloading image after Javascript .src call
Reporter | ||
Comment 1•7 years ago
|
||
Proof:
Press the "Reload Image" button several times, the images updates in others webbrowsers.
Not working in FF 57 (Windows & Linux Mint).
<html><body>
<img id="img_video" src="https://www.madariaga.com.ar/img/camaras/informatica2.jpg" />
<button onclick="ReloadImage()">Reload Image</button>
<script>
function ReloadImage() {
document.getElementById('img_video').src = 'https://www.madariaga.com.ar/img/camaras/informatica2.jpg';
}
</script>
</body></html>
Component: Untriaged → DOM: Core & HTML
Keywords: regression,
regressionwindow-wanted
Product: Firefox → Core
Comment 2•7 years ago
|
||
This is no recent regression because Firefox29 (from 2014) shows the same issue.
The Image is stored in the memory cache with "Expired Immediately" and deactivating memory and disk cache doesn't help.
Changing the URL every time makes this work:
document.getElementById('img_video').src = 'https://www.madariaga.com.ar/img/camaras/informatica2.jpg?' +new Date();
This is the opposite bug of bug 1127874
![]() |
||
Updated•7 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression,
regressionwindow-wanted
Version: 57 Branch → Trunk
Comment 3•7 years ago
|
||
Is this supposed to be covered in Bug 1076583?
Flags: needinfo?(echen)
Priority: -- → P3
Comment 4•7 years ago
|
||
IIRC, yes, this is supposed to be covered in Bug 1076583. Let me try if I could split the fix for this case to here.
Assignee: nobody → echen
Flags: needinfo?(echen)
Reporter | ||
Comment 5•7 years ago
|
||
New Firefox 58.0 (x64 on Windows 10) and the bug still there.
Firefox 56 and older are working fine.
Example:
https://www.madariaga.com.ar/?q=camaras-en-vivo
Open it with Chrome, press F12 and then the Network tab.
The image is correctly reloaded every second (sends the not to cache headers).
With Firefox 57 and 58 nothing happens.
You need to log in
before you can comment on or make changes to this bug.
Description
•