Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Focus Mobile Browser with Javascript

I need to show turn-by-turn navigation on my mobile site (a SignalR project. just Chrome). I googled it. But there is not (or not not but i didn't found usefull something) api for this. So i put the a tag with href="google.location=q.." It opens Google Maps. I checked SignalR. Connection ok even if page is running background. I can send a message from server to this client. Message received. But user cannot show. (Because Google Maps is open.:))

Can i show alert, notification or focus browser (or close googlemaps) with javascriptly when browser isn't active?

hub.client.receivemessage = function (from, msj) {
                //alert or something that will provide to open browser 
            };

Thanks for advice.

like image 923
a.u.b Avatar asked Aug 31 '26 09:08

a.u.b


1 Answers

If I'm understanding correctly, the user can't read the notification because google maps is in the way. Html5 supports desktop notifications and can be displayed above all content. https://developer.mozilla.org/en-US/docs/Web/API/notification has the documentation.

like image 88
Josh Avatar answered Sep 02 '26 23:09

Josh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!