问题
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