I’m pretty new in programming javascript. I wrote a little .js file that scrapes the live departures of a certain public transport tramway station. It works perfect but I’m struggling to integrate it in HADashboard.
In Hadashboard I just want to display the text in White with transparent background.Tried to import it as an iframe but HADashbaord can’t get access to the file no matter where I put it in the appdaemon folder.
However, it still shows that little broken icon in the top left. The debugger console gives me warning that Provisional headers are shown. Any idea on how to get my iframe displayed?
first try to get it working outside the dashboard in a browser.
if that works it normally should work in the iframe.
and try to avoid external javascripts.
just paste the script inside the html page.
it works perfect in the browser with the http: path to custom css. I also tried to put in an iframe in another html file and that worked too. I really don’t understand it. I sometimes get this error in the console “Cross-Origin Read Blocking (CORB) blocked cross-origin response” on the HADashboard Panel.
I changed the code slightly heres the new one:
hadashboard yaml:
i really have no idea, i am absolutely no expert in JS.
i wouldnt go the way you do.
i would scrape the webpage with HA or with an appdaemon app, create sensors out of it and then show the sensors in the dashboard.
there are all kind of problems when you use websites that connect to other websites and then also in javascripts.
its exactly this kind of programming that hackers use, and thats why browsers block it.