hass-browser_mod icon indicating copy to clipboard operation
hass-browser_mod copied to clipboard

navigate service option for new tab/window?

Open gmcmicken opened this issue 5 years ago • 6 comments

Can the navigate option accept an additional parameter to allow setting the target, such as to open a new browser window or tab with the specified URL?

gmcmicken avatar Nov 11 '20 21:11 gmcmicken

Can you give an example use case?

KTibow avatar Nov 12 '20 02:11 KTibow

My specific use case is to launch spotify queue in a new window when I start playback using a playlist card or some other card/button etc.

But there are likely other similar use cases where someone is executing a script and for whatever reason they need to view or interact with something outside of HA. I imagine it would be for things that aren't supported/integrated into HA, like proprietary devices where the HA action is maybe only to toggle a smart switch and the actual interaction is done in the native web app.

gmcmicken avatar Nov 13 '20 03:11 gmcmicken

Huh. You know you might able to use the markdown card for that. IMO it kind of violates the purpose of HA, that's why we have an iframe card, and if it has a CORS policy just use https://cors-anywhere.herokuapp.com/

KTibow avatar Nov 13 '20 14:11 KTibow

My use case is not one where I would even want it inside HA though. I have 1 always displayed dashboard in HA as a smart home control panel and I want "windows" to pop up if some interaction needs to be done instead of navigating to a different layout/dashboard. Basically no navigation.

So to do a functionally equivalent version inside HA I would need to do use an iframe card, some iframe policy override, with a custom popup, and then card mod to get the width height what I need. Whereas if I simply use window.open from JS it will launch spotify in a PWA window that's chromeless and on top of HA while it's needed, then closed.

gmcmicken avatar Nov 13 '20 19:11 gmcmicken

Well this isn't too hard to implement, just look at #93.

KTibow avatar Nov 13 '20 19:11 KTibow

Isn't it essentially what #12 is asking for ?

FrnchFrgg avatar Dec 29 '22 21:12 FrnchFrgg