无法突出显示javascript警告框 [英] Unable to highlight javascript alert box

查看:71
本文介绍了无法突出显示javascript警告框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用angularJS处理单页应用程序,该应用程序可在Intranet上运行。其中一个要求是每15分钟后我必须强行向用户显示一条消息,即使他正在处理其他程序,并且一旦他自动点击OK按钮,就需要显示浏览器标签。此功能需要在IE11 / IE Edge / Chrome / Mozilla Firefox上运行。



有没有解决方法呢?

有没有其他好的解决方案?



我优先考虑IE / Edge。





提前致谢。



我尝试了什么:



当我尝试使用Chrome的Javascript警告框时按预期工作,但当我尝试使用Firefox和IE时它突出显示选项卡。除非用户进入该选项卡警告框未显示。

I am working on a single page application using angularJS which will work on Intranet. One of the requirement is after every 15 min i have to forcefully show a message to the user even if it he is working on some other program and once he click on OK button automatically that browser tab need to be shown. this functionality need to work on IE11/IE Edge/Chrome/Mozilla firefox.

Is there any workaround for this?
Is there any other good solution?

I have priority for IE/Edge.


Thanks in advance.

What I have tried:

when i tried Javascript alert box with chrome it works as expected but when i tried it with firefox and IE it highlight the tab. unless user goes to that tab alert box doesn't shown up.

推荐答案

如评论中所述,不,除了创建一个之外没有办法做到这一点您要支持的每个浏览器的插件。浏览器正在逐渐允许开发人员出于安全原因强制用户使用某些方法。
As mentioned in the comments, no, there is no way to do this except for creating a plugin for each browser you want to support. Browsers are moving away from allowing developers to force users certain ways for security reasons.


这篇关于无法突出显示javascript警告框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆