有一个 userscript,元信息[1]没有严格对齐,可以工作,但是不美观,怎么办呢? // ==UserScript== // @name Github Commented Issues // @namespace https://github.com/jiacai2050 // @description / @version 0.2.3 // @icon https://github.githubassets.com/favicons/favicon.svg // @grant none // ==/UserScript 2] • GROUP 标明正则式中哪个 group 用做修改来达到对齐效果 • SPACING 不同列之间的空格数 • REPEAT 是否作用在这一整行上,在本示例无所谓,因为最终只有两列 // ==UserScript == 最后,封装成一个函数 (defun my/align-userscript-metablock (start end) (interactive "r") (align-regexp start
看能否实现,如下:图片可以发现能够获取到,下一步就来考虑如何通过Safari Extension脚本编辑来实现自动移除.首先,安装一个 Safari Extension, Userscripts或Stay-Userscript item.remove(); } xxx } } }所以参照上面的代码,实现自己的如下:// ==UserScript Navbar and skybar// @description Remove Hacking With Swift Navbar and skybar// @match *://*/*// ==/UserScript 最终代码如下:// ==UserScript==// @name Remove Hacking With Swift Navbar and skybar// @description Remove Hacking With Swift Navbar and skybar// @match *://www.hackingwithswift.com/* // // ==/UserScript==(function
语法规则 // ==UserScript== // @key value // ==/UserScript== 字段释意: 基本信息 @name:脚本的名字(自定义) @author 作者。 支持正则语句 注意: @include 不支持 URL 哈希参数,必须匹配没有哈希参数的路径并使用 示例: // ==UserScript== // @name New Userscript domain=tampermonkey.net // @grant none // ==/UserScript== (function() { 'use strict'; 如果脚本在单页应用程序上运行,那么它可以使用 window.onurlchange 来监听 URL 更改: // ==UserScript==...// @grant window.onurlchange // ==/UserScript==if (window.onurlchange === null) { // feature is supported window.addEventListener
// ==UserScript== // @name Moot解除限制 // @namespace gu // @version 0.1 // @description // @author Lan // @match *://www.51moot.net/* // @grant none // ==/UserScript==
通过编写用户脚本(UserScript),我们可以修改网页的内容和样式,甚至添加新的功能。油猴支持多种浏览器,如Chrome、Firefox、Edge等。 在打开的编辑器中,输入以下代码: // ==UserScript== // @name 修改背景颜色 // @namespace http://tampermonkey.net @description 修改指定网站的背景颜色 // @match https://example.com/* // @grant none // ==/UserScript 输入以下代码: // ==UserScript== // @name 隐藏广告 // @namespace http://tampermonkey.net/ // @version description 隐藏指定网站的广告 // @match https://newswebsite.com/* // @grant none // ==/UserScript
国培计划油猴脚本 功能 跳过确认按钮,一直学呀学 视频0.1倍速 // ==UserScript== // @name 2021教师能力提升 // @namespace http: @license MIT // @grant none // @grant unsafeWindow // @grant GM_addStyle // ==/UserScript
比如文初开头的完整代码如下: // ==UserScript== // @name ooxx网站 // @namespace http://tampermonkey.net/ / id=2 // @grant none // ==/UserScript== /* jshint -W097 */ 'use strict'; // Your code here... 代码最终如下: // ==UserScript== // @name zdfans // @namespace http://tampermonkey.net/ // @version // @author You // @match http://www.zdfans.com/* // @grant none // ==/UserScript= html [4] JS破解乌云验证码 http://zone.wooyun.org/content/18101 [5] OCR 在线识别验证码 http://lab.ocrking.com/ [6] UserScript
如下图: 然后找到暴力猴,点击 dashboard,新增一个 script,把上面混元助手生成的代码稍微修改后添加进去,并设置匹配的网站,最终如下: // ==UserScript== // @name sz=64&domain=jianshu.com // @grant none // ==/UserScript== (function() { 'use strict'; 那尝试一下添加个1秒延时再去删除,测试后,发现生效了,最终代码如下: // ==UserScript== // @name 简书登录弹窗、推荐、侧边移除 // @namespace sz=64&domain=jianshu.com // @grant none // ==/UserScript== (function() { 'use strict'; sz=64&domain=jianshu.com // @grant none // ==/UserScript== (function() { 'use strict';
可以理解为页面加载完毕后的一种页内刷新,可以实现页内类容的即时更新,避免网页刷新的麻烦,个人的理解有限,可能有理解不到位的地方,具体的可以百度查查) 直接上代码,第一个 跳过Vedio(据说后台会记录观看时间,请谨慎使用) // ==UserScript @author Karos // @match https://xueyuan.yooc.me/courses/* // @grant none // ==/UserScript ;//这个提示觉得碍眼直接注释or直接删掉 'use strict'; })(); 第二个,解除F12和右键的禁用(这个东西到处都有,我直接转载CSDN的) // ==UserScript author moreant // @match https://www.yooc.me/group/*/exam/* // @grant none // ==/UserScript
额,自行百度,先给你说是浏览器扩展插件,安装教程和使用教程百度都有,我只放代码 // ==UserScript== // @name 易班视频跳过js // @namespace // @match https://xueyuan.yooc.me/courses/*/*/*/courseware/*/* / // @grant none // ==/UserScript
网页会判断鼠标是否在页面上,不在2s后则会被暂停, 目前脚本只是让他自动运行,因需求不高,故到此结束 油猴脚本:点我 // ==UserScript== // @name 昆明市导游在线培训系统 domain=baidu.com // @grant none // ==/UserScript== (function() { setInterval(function () { //
chrome页面效果如下:油猴控制台如下:油猴脚本内容如下:// ==UserScript==// @name Display Current Time in Top Center// @match *://*/*// @grant none// ==/UserScript==(function() { 'use strict'; // 获取当前时间并格式化为字符串
每次打开浏览器时,总是会跳到一个其他的网页上,关也关不掉,很烦,写一个脚本直接跳转 // ==UserScript== // @name 页面跳转 // @version 1.0.1 GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_listValues // ==/UserScript
链接到该网页的缓存版本 这就方便多了 安装地址 https://greasyfork.org/zh-CN/scripts/500422-google-cache-viewer 脚本代码 // ==UserScript * // @grant none // @license MIT // ==/UserScript== (function() { 'use strict';
可以使用多个标签, 获取资源内容是用 GM_getResourceText(name)与GM_getResourceURL(name) // ==UserScript== // @name resource bootstrapcss https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css // ==/UserScript
还有个更好的方法,就是使用油猴脚本,下面是我自定义的油猴脚本,代码如下:// ==UserScript==// @name 微信文章自动加载图片// @namespace http data-src 转为 src,方便剪藏// @author You// @match *://mp.weixin.qq.com/*// @grant none// ==/UserScript
将里面代码替换为: // ==UserScript== // @name Redirect arxiv.org to CN.arxiv.org/pdf // @namespace uso2usom @include http://*.* // @include https://*.* // @version 1.2 // @grant none // ==/UserScript == // This is a slightly brute force solution, but there is no other way to do it using only a userscript
(下面的脚本内容来做网上) // ==UserScript== // @name totop // @namespace http://unamerrr.net/ // @version / @match *://*/* // @description 返回顶部 // @author unamerrr // @grant none // ==/UserScript
安装地址:https://greasyfork.org/en/scripts/429688-emacs-china-user-blocker // ==UserScript== // @name emacs-china.org/uploads/default/optimized/2X/d/dd05943671ee57856f9d7fa7ba6497f31bfcd332_2_180x180.png // ==/UserScript
官方对该插件的描述只有一句“The world’s most popular userscript manager”,即第一个可以用来让 Chrome 支持更多 UserScript 的 Chrome