mathoudebine / homeassistant-browser-control-card

Control your browser from a Home Assistant lovelace card: full screen, disable screen lock, zoom, reload page...
MIT License
12 stars 0 forks source link

Custom element doesn't exist: browser-control-card. #10

Closed kismomesz closed 1 year ago

kismomesz commented 1 year ago

After updating the Home Assistant in version 2023.2.4, it does not appear. But it was released in 2022. 11. image

KennethLavrsen commented 1 year ago

I now suddenly have the same issue.

TB-SE commented 1 year ago

+1

Home Assistant 2023.10.1 Supervisor 2023.10.0 Operating System 10.5 Frontend 20231005.0 - latest

lecrams commented 1 year ago

+1

Home Assistant 2023.10.1 Supervisor 2023.10.0 Operating System 10.5 Frontend 20231005.0 - latest

AlexQuaken commented 1 year ago

+4, four more instancesm from yesterday

AlexQuaken commented 1 year ago

The card uses a component from an external source; for example, if there's no internet connection, it won't work either. It needs external access to download something, and I suppose this external source is down, which is why the card isn't launching.

KennethLavrsen commented 1 year ago

I only ever used the feature for reloading because on my iPad I cannot do control refresh and clearing cache for the site is a pain. So this component was nice for a one click refresh of all css and js

I unstalled it and installed Lovelace Html Card instead. With that I could add button in html that runs the javascript one liner to reload the page without using the cache.

TB-SE commented 1 year ago

I unstalled it and installed Lovelace Html Card instead. With that I could add button in html that runs the javascript one liner to reload the page without using the cache.

Interesting, I'm guessing you are using: location.reload(true)

Would you perhaps be willing to share your yaml for this implementation?

KennethLavrsen commented 1 year ago

Sure. After installing Lovelace HTML card from HACS I added this card

type: custom:html-card
content: |
  <p><b>Reload HTML</b></p>
  <p><button type="button" onClick="window.location.reload(true)">
   Window Reload Page
  </button></p>
  <p><button type="button" onClick="document.location.reload(true)">
   Document Reload Page
  </button></p>

I think the two does the same but I was not sure.

TB-SE commented 1 year ago

Sure. After installing Lovelace HTML card from HACS I added this card

type: custom:html-card
content: |
  <p><b>Reload HTML</b></p>
  <p><button type="button" onClick="window.location.reload(true)">
   Window Reload Page
  </button></p>
  <p><button type="button" onClick="document.location.reload(true)">
   Document Reload Page
  </button></p>

I think the two does the same but I was not sure.

Cheers! I was a bit unsure how to implement it, but this is definitely straight forward. Yeah, the second button probably is unnecessary, the first one does the job just fine.

I added a haptic feedback Javascript and some CSS, so everything looks and works just as before. 👍🏻

AlexQuaken commented 1 year ago

Sure. After installing Lovelace HTML card from HACS I added this card

type: custom:html-card
content: |
  <p><b>Reload HTML</b></p>
  <p><button type="button" onClick="window.location.reload(true)">
   Window Reload Page
  </button></p>
  <p><button type="button" onClick="document.location.reload(true)">
   Document Reload Page
  </button></p>

I think the two does the same but I was not sure.

You can suggest how to add zoom functionality as before two buttons + - 10%

mathoudebine commented 1 year ago

Hey everyone, thanks for the feedback! I was not notified of this issue, don't know why. I will try to fix it soon!

mathoudebine commented 1 year ago

Issue is now fixed in v1.3.1, it was due to a lit module upgrade because the version used in this card was not specified. Please update through HACS to get the fix.

mathoudebine commented 1 year ago

The card uses a component from an external source; for example, if there's no internet connection, it won't work either. It needs external access to download something, and I suppose this external source is down, which is why the card isn't launching.

I agree using an external component is not ideal for offline devices. I will think about changing it to a local component if possible

lecrams commented 1 year ago

I replaced the JS with the new 1.3.1 and rebooted. Still the same issue unfortunately

mathoudebine commented 1 year ago

I replaced the JS with the new 1.3.1 and rebooted. Still the same issue unfortunately

If you are installing the .js manually you will need to clear your browser cache to reload it

lecrams commented 1 year ago

I used CTRL F5 to refresh so that should normally be enough

mathoudebine commented 1 year ago

Depending on your browser, you may need to use Ctrl+Shift+R or explicitly clear the cache at least for your HomeAssistant URL

lecrams commented 1 year ago

After upgrading to core 2023-10.4 the issue is back!

mathoudebine commented 1 year ago

I'm actually running core 2023.10.5 and the issue did not come back. If you are installing this card manually from the .js, you need to tell HomeAssistant that there is a new version otherwise it will put the .js in cache and will not reload it.

When installing by HACS this is done automatically by adding a "hacstag" after the .js URL in resouces: image

You may need to do this manually: follow this answer https://community.home-assistant.io/t/lovelace-custom-card-not-updating/88602/5 It doesn't matter what is added after the URL (either a ?v= or ?hacstag= or anything), just that the value must change each time the .js is updated to clear the HomeAssistant cache.

lecrams commented 1 year ago

I was indeed installing it manually. That explains the behaviour. I have removed it now also manually and reinstalled and now it is working again.

Thx for the explanation