-
I have recently come up with a use case for wanting to be able to click on a SVG and have that open a new browser window. I have tried many options but nothing seems to work. In my old reference guide there were floorplan calls of
but that throws this error: In the action line I have tried url, navigate and call-service In just about every combination I have tried nothing happens on the click. No message on screen, nothing in the floorplan log and nothing inthe HA logs. If I use the above with a URL outside of HA then I get that error. If I use Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
@exetico any ideas? |
Beta Was this translation helpful? Give feedback.
-
You're asking for a function to navigate out of Home Assistant, of the current window where you have Home Assistant running, right? As you've found out, Our function are simular to navigation_path in Home Assistant, which are only made for navigation around the lovelace UI. There is a Here's a simple example where
It's generally bad practice to allow navigation to another URL in a env. like this, and I bet that's why Home Assistant are not allowing that as pr. default. Are you primary need to open a new window, or change current window, to another external page? In Home Assistant, you only have the option to open a new window with We could just extend the functions and allow the usage of However, it is You could consider to ask the Home Assistant dev's (on GitHub) if there's a specific reason why window.location.replace are not allowed/supported as we speak. I'm not sure if HA are normally limiting the amount of With that said, As you can hear, I'm not that into the security-perspectives, if there's anything we should consider before implementing it. |
Beta Was this translation helpful? Give feedback.
-
With that said.. I guess it's a bit dump to talk about security, now that the ha-floorplan user are allowed to execute native JavaScript in the browser, so here's an ugly hack:
You would need to add the empty-service, for this to work without an error. It's a bit ugly... But it will work. ALSO: Thank you for spending your time with all the users in the Discussion, @OzGav! It's almost the most important thing in this project... allowing the user-base to grow, day by day 🥳 ! |
Beta Was this translation helpful? Give feedback.
-
#185 now pushed to master-branch. https://github.com/ExperienceLovelace/ha-floorplan/releases/tag/1.0.30 are now ready, too. |
Beta Was this translation helpful? Give feedback.
#185 now pushed to master-branch. https://github.com/ExperienceLovelace/ha-floorplan/releases/tag/1.0.30 are now ready, too.