我正在使用最新版本的 Firefox,我想禁用 .focus() 函数对网站的使用,有什么办法可以做到这一点?
有一个 Greasemonkey 脚本旨在允许您为 Google 禁用此功能。
其源代码在这里:
// ==UserScript==
// @name Google Disable Auto Focus
// @namespace googleDisableAutoFocus
// @include /^http:\/\/(www\.)?google\.c(a|om)\/?$/i
// @include http://www.google.tld/
// @match http://www.google.com/
// @match http://www.google.ca/
// @run-at document-start
// @datecreated 2010-02-21
// @lastupdated 2010-02-21
// @version 0.1
// @author Erik Vergobbi Vold
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @description This userscript will disable Google's auto focus
// ==/UserScript==
document.body.setAttribute("onload","");
Run Code Online (Sandbox Code Playgroud)
现在,您可以将执行此操作的站点添加为该==UserScript==
部分中的附加 @match 行,但不能保证它会起作用。但如果设置了焦点事件onload
,那么它就会。但它可能会影响其他网站的行为。
归档时间: |
|
查看次数: |
2536 次 |
最近记录: |