Javascript chrome 撤销“阻止此页面创建其他对话框”的操作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11261519/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 05:11:16  来源:igfitidea点击:

chrome undo the action of "prevent this page from creating additional dialogs"

javascriptgoogle-chromealert

提问by prongs

I sometimes find that I need to re-enable alerting for debugging. Of course I can close the tab and reload it but Is there a better way?

我有时发现我需要重新启用调试警报。当然我可以关闭选项卡并重新加载它,但是有更好的方法吗?

采纳答案by Per Salbark

No. But you should really use console.log()instead of alert()for debugging.

不,但你真的应该使用console.log()而不是alert()用于调试。

In Chrome it even has the advantage of being able to print out entire objects (not just toString()).

在 Chrome 中,它甚至具有能够打印出整个对象(不仅仅是toString())的优势。

回答by dentaku

Close the tab of the page you disabled alerts. Re-open the page in a new tab. The setting only lasts for the session, so alerts will be re-enabled once the new session begins in the new tab.

关闭您禁用警报的页面的选项卡。在新选项卡中重新打开页面。该设置仅对会话有效,因此一旦新会话在新选项卡中开始,将重新启用警报。

回答by Graham

So the correct answer is: YES, there is a better way.

所以正确答案是:是的,有更好的方法。

Right click on the tab and select "Duplicate", then close the original tab if you wish.

右键单击选项卡并选择“复制”,然后根据需要关闭原始选项卡。

Alerting is re-enabled in the duplicate.

在副本中重新启用警报。

The duplicate tab seems to recreate the running state of the original tab so you can just continue where you were.

重复选项卡似乎重新创建了原始选项卡的运行状态,因此您可以继续原来的位置。

回答by Andrew Faulkner

2 more solutions I had luck with when neither tab close + reopening the page in another tab nor closing all tabs in Chrome (and the browser) then restarting it didn't work:

2更多解决方案我没有运气,当没有选项卡关闭+重新打开另一个选项卡中的页面并关闭Chrome中的所有选项卡(以及浏览器),然后重新启动它不起作用:

1) I fixed it on my machine by closing the tab, force-closing Chrome, & restarting the browser without restoring tabs (Note: on a computer running CentOS Linux).

1) 我通过关闭选项卡、强制关闭 Chrome 并重新启动浏览器而不恢复选项卡来修复它在我的机器上(注意:在运行 CentOS Linux 的计算机上)。

2) My boss (also on CentOS) had the same issue (alerts are a big part of my company's Javascript debugging process for numerous reasons e.g. legacy), but my 1st method didn't work for him. However, I managed to fix it for him with the following process:

2)我的老板(也在 CentOS 上)遇到了同样的问题(出于多种原因,例如遗留问题,警报是我公司 Javascript 调试过程的重要组成部分),但我的第一种方法对他不起作用。但是,我设法通过以下过程为他修复了它:

  • a) Make an empty text file called FixChrome.sh, and paste in the following bash script:

    #! /bin/bash
    cd ~/.config/google-chrome/Default     //adjust for your Chrome install location
    rm Preferences
    rm 'Current Session'
    rm 'Current Tabs'
    rm 'Last Session'
    rm 'Last Tabs'
    
  • b) close Chrome, then open Terminal and run the script (bash FixChrome.sh).

  • a) 创建一个名为 FixChrome.sh 的空文本文件,并粘贴以下 bash 脚本:

    #! /bin/bash
    cd ~/.config/google-chrome/Default     //adjust for your Chrome install location
    rm Preferences
    rm 'Current Session'
    rm 'Current Tabs'
    rm 'Last Session'
    rm 'Last Tabs'
    
  • b) 关闭 Chrome,然后打开终端并运行脚本 (bash FixChrome.sh)。

It worked for him. Downside is that you lose all tabs from your current & previous session, but it's worth it if this matters to you.

这对他有用。缺点是您会丢失当前和上一个会话中的所有选项卡,但如果这对您很重要,这是值得的。

回答by Marwah Abdelaal

open a new window or tab with the same link.. the PREVENT option lasts per session only..

打开一个具有相同链接的新窗口或选项卡.. PREVENT 选项仅在每个会话中持续..

回答by Yves

If you wish dialog box to be re-activated for the page you set as prevent dialog box to show.

如果您希望为您设置为阻止对话框显示的页面重新激活对话框。

Chrome: select settings, a google page for chrome will open with all your settings for chrome.

Chrome:选择设置,Chrome 的 google 页面将打开,其中包含您对 chrome 的所有设置。

At the very bottom, go to advance settings and at the bottom of the advance settings you may click on Resset Browser Settings... this will make dialog box appear as they should.

在最底部,转到高级设置,在高级设置的底部,您可以单击重置浏览器设置...这将使对话框按原样显示。

回答by TJ SHEPPARD

Turning Hardware Acceleration OFF seems to be the setting that affects popups & dialogs.

关闭硬件加速似乎是影响弹出窗口和对话框的设置。

Chrome was continually hiding Dialog Windows when I needed to respond Yes or No to things, also when I needed to Rename folders in my bookmarks panel. After weeks of doing this. I disabled all the Chrome helpers in Settings, Also In windows 10 I switched Window Snapping off. It has done something to put the popups and dialogs back in the Viewport.

当我需要对事物做出“是”或“否”响应时,以及当我需要在我的书签面板中重命名文件夹时,Chrome 会不断隐藏对话框窗口。经过数周的这样做。我在设置中禁用了所有 Chrome 助手,也在 Windows 10 中我关闭了窗口捕捉。它已将弹出窗口和对话框放回视口中。

When this bug is happening, I was able to shut a tab by first pressing Enter before clicking the tab close X button. The browser had an alert box, hidden which needed a response from the user.

发生此错误时,我可以通过在单击选项卡关闭 X 按钮之前先按 Enter 来关闭选项卡。浏览器有一个隐藏的警告框,需要用户做出响应。

Switching Hardware Accleration Off and back On, Killing the Chrome process and switching all the other Helpers Off and back has fixed it for me... It must be in chrome itself because Ive just gone into a Chrome window in the Mac and it has now stopped the problem, without any intervention. Im guessing flicking the chrome settings on/off/on has caused it to reposition the dialogs. I cant get the browser to repeat the fault now...

关闭并重新打开硬件加速,杀死 Chrome 进程并关闭和关闭所有其他帮助程序已经为我修复了它......它必须在 Chrome 本身中,因为我刚刚进入 Mac 中的 Chrome 窗口,现在它已经停止了问题,无需任何干预。我猜测打开/关闭/打开镀铬设置已导致它重新定位对话框。我现在无法让浏览器重复错误...