tampermonkey

How can I access built-in methods of an Object that is overridden?

瘦欲@ 提交于 2021-01-04 02:47:22
问题 A webpage is setting a built-in javascript method to null , and I'm trying to find a way to call the overridden methods in a userscript. Consider the following code: // Overriding the native method to something else document.querySelectorAll = null; Now, if I try to execute document.querySelectorAll('#an-example') , I will get the exception Uncaught TypeError: null is not a function . The reason being the method has been changed to null and is no longer accessible. I'm looking for a way to

How can I access built-in methods of an Object that is overridden?

假如想象 提交于 2021-01-04 02:46:59
问题 A webpage is setting a built-in javascript method to null , and I'm trying to find a way to call the overridden methods in a userscript. Consider the following code: // Overriding the native method to something else document.querySelectorAll = null; Now, if I try to execute document.querySelectorAll('#an-example') , I will get the exception Uncaught TypeError: null is not a function . The reason being the method has been changed to null and is no longer accessible. I'm looking for a way to

Favicon disappears after preventing execution of a specific inline script tag by Tampemonkey

喜欢而已 提交于 2020-12-15 05:45:28
问题 I use this code in Tampermonkey to prevent certain script tag from executing: https://stackoverflow.com/a/50024143/8849796 (function() { 'use strict'; window.stop(); const xhr = new XMLHttpRequest(); xhr.open('GET', window.location.href); xhr.onload = () => { var html = xhr.responseText .replace(/<script\b[\s\S]*?<\/script>/g, s => { // check if script tag should be replaced/deleted if (s.includes('window.location')) { return ''; } else { return s; } }); document.open(); document.write(html);

Favicon disappears after preventing execution of a specific inline script tag by Tampemonkey

有些话、适合烂在心里 提交于 2020-12-15 05:45:14
问题 I use this code in Tampermonkey to prevent certain script tag from executing: https://stackoverflow.com/a/50024143/8849796 (function() { 'use strict'; window.stop(); const xhr = new XMLHttpRequest(); xhr.open('GET', window.location.href); xhr.onload = () => { var html = xhr.responseText .replace(/<script\b[\s\S]*?<\/script>/g, s => { // check if script tag should be replaced/deleted if (s.includes('window.location')) { return ''; } else { return s; } }); document.open(); document.write(html);

Prevent default single click event on double click on a link in HTML

前提是你 提交于 2020-12-13 04:05:35
问题 My code is pretty simple: var clickCount = 0, clickEl = []; var manualClick = false; $(document).on('click', 'a', function (e) { if (e.altKey || e.ctrlKey || e.shiftKey) { return; } clickCount = clickCount + 1; clickEl[clickCount] = this; var that = this; if (1 === clickCount) { setTimeout(function () { if (2 === clickCount && clickEl[1] === clickEl[2]) { window.stop(); embed_anchor(that); } clickCount = 0; }, 250); } }); It basically checks if there is double click. If yes, it cancel the

Prevent default single click event on double click on a link in HTML

核能气质少年 提交于 2020-12-13 04:05:07
问题 My code is pretty simple: var clickCount = 0, clickEl = []; var manualClick = false; $(document).on('click', 'a', function (e) { if (e.altKey || e.ctrlKey || e.shiftKey) { return; } clickCount = clickCount + 1; clickEl[clickCount] = this; var that = this; if (1 === clickCount) { setTimeout(function () { if (2 === clickCount && clickEl[1] === clickEl[2]) { window.stop(); embed_anchor(that); } clickCount = 0; }, 250); } }); It basically checks if there is double click. If yes, it cancel the

你竟然不装油猴插件-Chrome神器TamperMonkey

瘦欲@ 提交于 2020-12-04 01:41:22
> 油猴插件是一款可以在chrome浏览器中使用油猴脚本的插件。理解为脚本运行的平台 脚本 是一段代码,安装之后,有些脚本能为网站添加新的功能,有些能使网站的界面更加易用,有些则能隐藏网站上烦人的部分内容。 在 Greasy Fork 上的用户脚本都是由用户编写并向全世界发表的,可以免费安装,轻松体验。 插件安装地址 : chrome 商店地址 脚本下载地址 : greasyfork 脚本列表 了解它的强大 话不多说,一张图吓死你 没错,这仅仅是它热门的部分脚本,下一页还有更多 甚至你可以自己编写脚本 举个栗子 破解VIP会员视频集合 这个脚本我经常用,因为笔者喜欢看《海贼王》,但是 vip 续费很伤,所以每逢周日海贼王更新了,刚好又没充 vip,这个时候它就帮到了我。 点击左边的小绿角 ,就会进入一个神奇的网站完成视频的观看了 百度网盘直接下载助手 这个脚本的功能很浅显了,它就是下载用的 网页限制解除 解除禁止复制、剪切、选择文本、右键菜单的限制 贴吧全能助手 更多的功能由读者自行探索了,油猴很强大,很吓人 设置,备份 通过 右键 &gt; 选项 可以进入设置页,对 油猴插件 更个性化的设置 还可以云端备份哦 更多 更多优秀工具,请 关注微信公众号 获取 来源: oschina 链接: https://my.oschina.net/u/2716410/blog/3114250