Can I modify chrome://extensions/ page with JavaScript(user script)?

人盡茶涼 提交于 2019-11-27 16:23:15

A Chrome extension won't execute in the chrome://extensions/ directory or on the Chrome Web Store or a few other important areas for security.

One easy way to think of it is that if an extension had access to the DOM in your Chrome Extensions page it could remove your ability to uninstall it, which could be pretty nasty for many users. You may want to look at the chrome.management API, however, if you want to build something outside the Extensions page to be able to search through a user's extensions.

chrome itself is not a permitted scheme, which is why you are getting an invalid scheme error. Here's what Google has to say about it:

A match pattern is essentially a URL that begins with a permitted scheme (http, https, file, or ftp), and that can contain '*' characters. The special pattern <all_urls> matches any URL that starts with a permitted scheme.

So by definition chrome as a scheme will not work no matter what. Think of it not as just another web page, but a part of Chrome's UI.

I think, that page is not "ordinary" web page, it's high security area, where you can't mess around with userscripts. That is what plugins are for.

You cannot inject a Content Script / User Script in chrome://extensions/ due to security reasons. You can use the Extension Management API page to create your own extension management extension.

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