題:
Chrome瀏覽器“確定要退出此頁面”插件
Pacerier
2015-04-11 20:34:48 UTC
view on stackexchange narkive permalink

在某些頁面上,如果您開始輸入內容,然後不小心關閉標籤或導航到另一頁面,則會彈出確認消息:

enter image description here

但是,這取決於站點,並且許多網站不支持此功能。

是否有Chrome插件要求對每個頁面進行確認 當我嘗試離開頁面時,其中的數據位於 <input> s和 <textarea> s中?

(FWIW - you'd *normally* say 'extension' in Chrome rather than 'addon'. Don't know whether that's *technically* correct tho)
@ᔕᖺᘎᕊ, If I say "extension" people might think I only want "extension". But I welcome "plugins" and "userscripts" too. "[Addon](http://stackoverflow.com/a/14380014/632951)" includes all that and all auxiliary stuff.
很有道理:)只是說什麼是“普通”而已:)
這是Chrome中的關鍵安全漏洞,許多希望禁用它的憤怒用戶都報告了該漏洞,但Chrome開發人員不會聽。看來他們是白痴。 https://bugzilla.mozilla.org/show_bug.cgi?id=578828#c76
@EveryoneIsStupid它以什麼方式存在安全問題?以及有關Chrome的問題,為什麼為什麼鏈接到有關Firefox的頁面?
一 回答:
ᔕᖺᘎᕊ
2015-04-11 22:20:26 UTC
view on stackexchange narkive permalink

不知道擴展名 ,但這是我製作的用戶腳本,它可以滿足您的要求:

  // == UserScript == / / @name確定要離開該頁面嗎?// @namespace http://stackexchange.com/users/4337810/// @version 1.0 // @description將確認對話框添加到瀏覽器中具有輸入/或文本區域/// @authorᔕᖺᘎᕊ(http://stackexchange.com/users/4337810/)// @match *:// * / * // @grant none // == / UserScript == document。 addEventListener('DOMContentLoaded',function(){var script = document.createElement('script'),head = document.getElementsByTagName('head')[0]; script.src =“ https://ajax.googleapis.com /ajax/libs/jquery/2.1.3/jquery.min.js“; if(jQuery的type =='undefined'){head.appendChild(script);} window.onbeforeunload = function(){if($(' textarea')。length || $('input')。length){if($。trim($('textarea')。val())!=''|| $ .trim($('i nput')。val())!=''){返回“您真的要離開嗎?您編寫的所有內容都將丟失!“;}};}},false);  

要使用它,請安裝 Tampermonkey,然後 then 此腳本

請注意,儘管這可能會在您訪問的許多頁面上觸發-因為當今幾乎所有網站都具有搜索欄作為輸入!但是我添加了另一項檢查,僅詢問字段是否為不為空-因此希望不會:)。如果需要,您可以通過添加 // @來排除網站將<site_url> 排除到元數據塊中:)



該問答將自動從英語翻譯而來。原始內容可在stackexchange上找到,我們感謝它分發的cc by-sa 3.0許可。
Loading...