dynamically change Tampermonkey script in Safari

浪子不回头ぞ 提交于 2019-12-11 13:22:03

问题


How can I make dynamically changed user script using Tampermonkey in Safari without actually open Tampermonkey and edit some code manually? I want to change the contents of a script on the fly. I used to do this in Chrome with @require attribute pointing to a javascript file in my file system. Then I programatically changed that javascript file accordingly. Worked like a charm. This doesn't work with Safari, due to it's security.

I tried manually changing the /Users/mainuser/Library/Preferences/com.apple.Safari.Extensions.plist file, but that results in corruption of Tampermonkey, since Safari doesn't like to see users changing it's preferences manually. It does some checks to see if someone tempered with it. Don't know which file should also be edited to avoid this. So the question remains, how can I dynamically change content of user script in Safari?

来源:https://stackoverflow.com/questions/37378796/dynamically-change-tampermonkey-script-in-safari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!