简体   繁体   中英

Bring the browser to the front of all window/application in php or javascript

I am developing a page in php and javascript and I need to be able to notify the user if they didn't submit the page within 10 minutes, for this to work I need to bring the browser in front of all other applications running on the machine.

Is there any possibility that this can be done?

Luckily you usually cannot do that. :)

PHP is a server-side language so it cannot do something like this for obvious reasons.

All you can do is call window.focus(); in JavaScript and hope it's not disabled in the user's browser - in Firefox it is disabled by default for example.

If you're users are willing to install a script you could try growl . You could then use the javascript api to create some notification.

ok, without html5 and that too user confirming the security popup, its impossible to bring the window on to front, atleast on IE it used to show a blink when there is a popup, but in chrome each runs on a seperate process and you wont even notice a blink too.

and well its not a mobile though, where you can use push notifications from the server to bring your app back

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM