Read the statement by Michael Teeuw here.
Image in module not showing on mirror browser
-
HI,
I have an issue where an image is not loading on the browser of the mirror itself, while on Firefox on my laptop, it shows.The image is loaded in MMM-Sonos:
if (item.track.albumArtURI !== null && item.track.albumArtURI !== undefined && item.track.albumArtURI.trim() !== "") { albumCover.innerHTML = `<img src="${item.track.albumArtURI}" width="80" height="80">`; } else { albumCover.innerHTML = `<img src="SonosRadio.png" width="80" height="80">`; } container.append(albumCover);
It seems to be some browser problem, because as said, on a laptop browser the image is shown.
Any ideas?
Thanks,
Dirk -
@lavolp3
Maybe CORS rule exception? -
@lavolp3
Hi, what happen really? only show default image? Or the same? Nothing?Maybe typeOf is better for check uri value
Maybe, InnerHtml is not the better way- create an img element
- use img.src=“uri”
- use an css class for width/height
- maybe add an seed for use not image cache
- create a function for update it
Can we see current full code for inspect?
-
@lavolp3 open the developers window and select the console tab to see the error
-
-
@bugsounet Hi thanks for the help.
Will consider reworking the code, but as said, it does work on an external browser, so the code itself should not be the issue, would it?
Rather the interpretation by the browser or any frontend behaviour when downloading the file. -
@lavolp3 use the cors service in MM… someone has to change the code to change the link
-
@sdetweil What’s the CORS service in MM?
I see I have been away for a while… -
@lavolp3 the systems are getting more sensitive to attackers everywhere
MM is on a system using 0.0.0.0 probably and that gets sent in the browser making the request and the remote system says, I don’t know where that it, its ‘NOT’ in my allowed systems…
-
use this as the url
Example input request url: http://address:port/cors?sendheaders=header1:value1,header2:value2&expectedheaders=header1,header2&url=http://www.test.com/path?param1=value1
so when you break that down
http://address:port MM address (can be localhost, or ip address) and port
url= the original url
sendheaders= whatever headers you need to set when sending
expectedheaders= whatever headers are expected on response