在chrome://settings和类似的网址上运行用户脚本 [英] run user script on chrome://settings and similar urls

查看:60
本文介绍了在chrome://settings和类似的网址上运行用户脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么篡改键对chrome://history/chrome://settings/这样的网址不起作用?还可以在此页面上运行用户脚本吗?

解决方案

不幸的是,这是不可能的,因为@match的能力不支持chrome方案(chrome://).

UserScript也使用Chrome的 match 规范,因此Chrome扩展程序不能这样做.也不行.

根据链接的规范:

主机权限和内容脚本匹配基于匹配模式定义的一组URL.匹配模式本质上是一个以允许的方案(httphttpsfileftp,并且可以包含'*'个字符)开头的URL.

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?

解决方案

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).

这篇关于在chrome://settings和类似的网址上运行用户脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆