run user script on chrome://settings and similar urls

只愿长相守 提交于 2019-12-01 21:17:11

问题


Why doesn't tampermonkey work on urls such as chrome://history/ or chrome://settings/? Any way to run an user script on this pages as well?


回答1:


Unfortunately, this isn't possible, because the chrome scheme (chrome://) isn't supported in @match's abilities.

UserScripts also use Chrome's match spec, so a Chrome extension to do that wouldn't work either.

From the linked spec:

Host permissions and content script matching are based on a set of URLs defined by match patterns. A match pattern is essentially a URL that begins with a permitted scheme (http, https, file, or ftp, and that can contain '*' characters).



来源:https://stackoverflow.com/questions/36228669/run-user-script-on-chrome-settings-and-similar-urls

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