andrei-tatar / node-red-contrib-smartnora

Node Red Google Home integration
https://smart-nora.eu/
109 stars 24 forks source link

Smart NORA web app manifest scope is too restrictive #248

Closed normanr closed 1 year ago

normanr commented 1 year ago

When opening the Smart NORA web app the Dashboard has a URL bar is rendered at the top (this does not happen for Manage groups or Notifications). This is because the app scope is https://smart-nora.eu/my-nora/, but the Dashboard canonical url is https://smart-nora.eu/my-nora which is outside of the scope (so not seen as part of the app, and URL bar is displayed, ref: https://developer.mozilla.org/en-US/docs/Web/Manifest/scope).

There are a couple of ways that this could be fixed:

The manifest start_url could be tweaked too (to match the canonical dashboard url), i.e. just remove the trailing slash, but it wouldn't change any functionaly.

The manifest id probably shouldn't be changed, as that will require the app to be reinstalled (and it's also not needed as the id is allowed to be out of scope, ref: https://developer.mozilla.org/en-US/docs/Web/Manifest/id)

andrei-tatar commented 1 year ago

@normanr thanks for the detailed description. I do have NORA installed but this behavior is not present on the Chrome + Android, for me. It does appear on Chrome + Windows.

I will have a look and fix it.

andrei-tatar commented 1 year ago

@normanr I removed the trailing slash in the manifest file. Should work fine now.

normanr commented 1 year ago

I had to reinstall the web app (both Chrome for Linux and Android had slightly different strange behavior after updating before reinstalling), but it works great now. Thanks!

andrei-tatar commented 1 year ago

@normanr interesting. I think it detects if an update was made in about 2-5 secs after load and it prompts for a refresh. That might've worked as well.

normanr commented 1 year ago

Yea, I was expecting the prompt and accepted it, but Chrome still showed the URL bar for the dashboard (even after removing the service worker, and force refreshing the app) until I reinstalled the web app.