Firefox57 Tampermonkey替换油猴 脚本导入方法

6,631次阅读
没有评论

Firefox升级至57后,全新的引擎极大的提高了浏览器的运行效率,但也带来了不少插件兼容性问题
其中一例就是在更新Firefox 57会导致部分油猴脚本(用户脚本)失效,这是因为Greasemonkey插件更新了4.0版本,在新的版本中,Greasemonkey更新了自身API的调用方式,导致先前使用GM API的脚本全部失效,Greasemonkey对于API调用方式的修改缺乏实际价值,而且没有提供对于旧接口的兼容和过渡,虽然Greasemonkey给开发者提供了相应的解决方案,但是该方案建立在修改旧脚本的基础之上,考虑到社区中已有大量油猴脚本,部分脚本的作者可能已经不再更新,Greasemonkey目前的做法无疑会给油猴脚本开发者、油猴脚本社区以及油猴脚本用户带来不必要的麻烦,这应该是软件开发过程中极力避免的问题
在这里给遇到上述问题的用户提供一个解决方法

在更新Firefox 57之后使用Tampermonkey插件替代Greasemonkey插件
https://addons.mozilla.org/firefox/addon/tampermonkey/

该插件在Firefox下的使用体验和Chrome下的同名脚本几乎一致,完全兼容先前脚本,而且目前看来比Greasemonkey 4具有更高的完成度。

脚本导入方法

找到Firefox用户配置文件夹,进入gm_scripts目录,搜索.user.js,全选压缩至zip文件,就可以在Tampermonkey实用工具标签中的压缩包导入了。

[Suggestion] [Firefox] Import userscripts from Greasemonkey #306

Unfortunately there is not automatic way to this, but you can import the scripts manually this way:

  • find your Firefox profile folder
  • enter the ‘gm_scripts’ folder
  • search for all files ending up on ‘.user.js’
  • zip them
  • import the zip at the “Utilities” tab at the Tampermonkey options page
 
 
正文完
 1
withero
版权声明:本站原创文章,由 withero 2017-11-20发表,共计948字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码