Chrome extension on an extension?

China☆狼群 提交于 2020-01-14 13:44:08

问题


Is it possible, even in a hacky way, to make a chrome extension for an already existing extension? Or to monkey patch an existing extension?

I wish to make some simple usability changes to a non-open source chrome extension.


回答1:


Chrome extensions can't access the internal pages of other extensions which have chrome-extension:// address (toolbar popup, page action popup, options page, background page), nor access the content scripts of other extensions.

The only case where it's possible to influence another extension (implying it's not expecting an external connection from another extension) is when that other extension depends on DOM events and messages and this is the extent of it.

There's a questionable method though: using the debugger API it's possible to execute code in the context of another extension, change its variables and so on. However a big notification will be displayed on every page in the browser:




回答2:


Get the source code and hack it

Once you have made your changes, all you have to do it enable developer mode in chrome://extensions and load up your hacky extension!



来源:https://stackoverflow.com/questions/33659315/chrome-extension-on-an-extension

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