如何在浏览器外编辑Tampermonkey脚本
How to edit Tampermonkey scripts outside of the browser
如何在浏览器外编辑Tampermonkey脚本?我宁愿在一个好的IDE中,而不是在浏览器中进行编辑。
当我在Firefox中开发Greasemonkey脚本时,我曾经能够做到这一点,但我无法在Chrome中找到。user.js文件。
进入扩展> Tampermonkey>允许访问文件url
然后,将脚本设置为:
// ==UserScript==
// @name Acecool - Video Site - Ultimate Video Site Management, Ad Removal, Redirection, Direct-Linking and more!
// @author Acecool
// @namespace Acecool
// @version 0.0.1
// @description Replaces encoded-links with decoded direct-links on episode finder sites.
// @description Automatically click the "continue" button, and attempt to skip the countdown if any, on video watching sites.
// @description Remove ad panels on video watching sites.
// @match http://*/*
// @require http://code.jquery.com/jquery-latest.js
// @require file:///C:/AcecoolGit/acecooldev_userscripts/libraries/acecool_functions_lib.js
// @require file:///C:/AcecoolGit/acecooldev_userscripts/video_sites/video_site_ultimate_tool.js
// @grant GM_xmlhttpRequest
// ==/UserScript==
我知道这对这个线程作者来说有点晚了,但这就是我如何开发…
然后,脚本设置了确切的头,因此我包含的示例文件:video_site_ultimate_tool.js是
// ==UserScript==
// @name Acecool - Video Site - Ultimate Video Site Management, Ad Removal, Redirection, Direct-Linking and more!
// @author Acecool
// @namespace Acecool
// @version 0.0.1
// @description Replaces encoded-links with decoded direct-links on episode finder sites.
// @description Automatically click the "continue" button, and attempt to skip the countdown if any, on video watching sites.
// @description Remove ad panels on video watching sites.
// @match http://*/*
// @require http://code.jquery.com/jquery-latest.js
// @require file:///C:/AcecoolGit/acecooldev_userscripts/libraries/acecool_functions_lib.js
// @require file:///C:/AcecoolGit/acecooldev_userscripts/video_sites/video_site_ultimate_tool.js
// @grant GM_xmlhttpRequest
// ==/UserScript==
alert( 'test script is running from the file system instead of from TM...' );
我将它们设置为相同的(好吧,我将文件系统脚本中的@require更改为http变体,因此functions_lib将转到bitbucket,而video_site_ultimate_tool将被删除,并且脚本将在复制到我的bitbucket repo时放入…
能够使用外部编辑器并让更改立即显示,这确实加快了开发速度…
希望这对下一个人有帮助。
由于Chrome扩展并没有真正访问文件系统(解释如下),Tampermonkey将脚本存储在内部存储器中。
你能做的是允许Tampermonkey访问你的本地文件,复制你的脚本头到Tampermonkey,另外,@require完整的脚本位于你硬盘的某个地方。
"don't really"意味着LocalFileSystem API允许文件访问,但名称和文件不一定映射到真正的文件系统。此外,LocalFileSystem现在似乎已被弃用。
相关文章:
- CKEditor Widget-阻止编辑可编辑元素本身
- 如何在angularJS中编辑时,如果DB中的值为true,则设置复选框,如果值为false,则取消选中复选框
- 高亮显示时编辑文本大小和颜色
- 剑道UI内联编辑:如何在点击其他按钮时隐藏按钮
- 将事件聚焦/模糊在可编辑内容的元素上
- 编辑HTML表的源数据
- ExtJS网格单元格编辑器,防止焦点松动问题
- 获取对使用Tampermonkey使用javascript创建的元素的引用
- 如何在visualstudio中调试web api时编辑javascript文件
- 具有所有样式的文本正在复制到可编辑文本区域
- 可以't使用PHP使用Froala编辑器上传图像URL
- 用Greasemonkey编辑专栏
- 如何在corona sdk中从CK编辑器中检索数据
- 基于数据类型的编辑框的汇总列表
- 如何使用jQuery可编辑插件检查ajax是否成功完成
- 错误:[$compile:nonassign]表达式'未定义'与指令'内容可编辑'是不可
- 如何在ng-reeat中使用ng-switch来编辑JSON API数据
- 如何将html元素添加到tampermonkey中
- 如何获取经过编辑的文本
- 如何在浏览器外编辑Tampermonkey脚本