Jar*_*ike 14 firefox greasemonkey javascript noscript
是否有一个 GreaseMonkey 脚本可以在 Firefox (3.0) 中禁用 JavaScript 的复制粘贴功能?或者我应该在任何尝试此操作的站点上运行 NoScript 或其他一些扩展程序(其他事情可能会中断......)?
[rant] 绝对是 JavaScript 最糟糕的“聪明”用法。幸运的是,Safari 更有用,并且忽略了禁用复制粘贴的 JavaScript hack。Mozilla 的谁认为这是可以接受的?耻辱。顺便问一下,哪个浏览器最先添加了这个“功能”,IE?[/咆哮]
如果您替换为,则divintogreasemonkey.org 上的(死链接) Anti-Disabler脚本可以工作document.document.wrappedJSObject.
链接现在似乎已失效,这是一个回溯链接:http://web.archive.org/web/20110830050224/http ://diveintogreasemonkey.org/download/antidisabler.user.js
这是脚本:
// Anti-Disabler
// version 0.5 BETA!
// 2005-06-28
// Copyright (c) 2005, Mark Pilgrim
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "Anti-Disabler", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name Anti-Disabler
// @namespace http://diveintomark.org/projects/greasemonkey/
// @description restore context menus on sites that try to disable them
// @include *
// @exclude http://mail.google.com/*
// @exclude https://mail.google.com/*
// ==/UserScript==
(function() {
var e, i, all;
document.onmouseup = null;
document.onmousedown = null;
document.oncontextmenu = null;
all = document.getElementsByTagName("*");
for (i = 0; i < all.length; i += 1) {
e = all[i];
e.onmouseup = null;
e.onmousedown = null;
e.oncontextmenu = null;
}
})();
//
// ChangeLog
// 2005-06-28 - 0.5 - MAP - updated GMail URL
// 2005-04-21 - 0.4 - MAP - linted
// 2005-04-21 - 0.3 - MAP - exclude GMail
// 2005-04-18 - 0.2 - MAP - tidy code
// 2005-04-01 - 0.1 - MAP - initial release
//
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8308 次 |
| 最近记录: |