简体   繁体   中英

Inject a content script into an iframe, within an action popup, of a different extension?

I need to be able to inject a content script into an iframe that is within an action's popup.html of another extension.

Previously, before an update to this extension in question, the extension injected the iframe into the active tab. I was able to configure my manifest like this:

"content_scripts": [{
    "matches": ["https://*.domain.com/*"],
    "js": ["content.js"],
    "all_frames": true
}],

It worked fine, the content script was injected into the iframe. Now this extension has the iframe in the action's popup.html and I can't get this to work.

Is there any way to accomplish this?

In general, you can't do this because chrome-extension: is not/no-longer a valid scheme .

However, if you can target the popup.html without using wildcards, you might be able to get to work by setting a "bad flag" in the Chrome://flags page .

Obviously, this will only work for your own personal browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM