简体   繁体   English

将内容脚本插入到其他扩展名的操作弹出窗口中的iframe中?

[英]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. 我需要能够将内容脚本注入到另一个扩展的动作的popup.html中的iframe中。

Previously, before an update to this extension in question, the extension injected the iframe into the active tab. 以前,在对该相关扩展程序进行更新之前,该扩展程序会将iframe注入到活动标签中。 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. 一切正常,将内容脚本注入了iframe。 Now this extension has the iframe in the action's popup.html and I can't get this to work. 现在,此扩展程序在动作的popup.html中包含了iframe,但我无法正常工作。

Is there any way to accomplish this? 有什么办法可以做到这一点?

In general, you can't do this because chrome-extension: is not/no-longer a valid scheme . 通常,您不能执行此操作,因为chrome-extension:不是/不再是有效的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 . 不过,如果你可以针对popup.html不使用通配符,你也许可以得到由工作设定在一个“坏标志” Chrome://flags

Obviously, this will only work for your own personal browser. 显然,这仅适用于您自己的个人浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Chrome扩展程序:如何响应内容脚本中的“弹出”操作? - Chrome extension: How to respond to the action from “popup” in the content script? Firefox / Chrome Web扩展-尝试通过内容脚本注入IFrame时出现安全错误 - Firefox/Chrome Web Extension - Security Error When Trying To Inject IFrame Through Content Script Chrome 扩展:与嵌入在弹出窗口中的 iframe 交互 - Chrome Extension: Interacting with iframe embedded within popup 在不同域的iframe中注入脚本 - inject script inside iframe of different domain 在content.js(Chrome扩展程序)中发生操作时,如何检查popup.html页面? - How to check popup.html page when action occurs within content.js (Chrome Extension)? 将按钮注入网站(Chrome扩展程序内容脚本) - Inject button into site (Chrome Extension content script) Chrome扩展程序:创建标签然后将内容脚本注入其中 - Chrome extension: create tab then inject content script into it 内容脚本未在另一个扩展程序页面中的iframe中运行 - Content script isn't running in iframe within another extension's page 从扩展程序到内容脚本的Chrome扩展消息传递 - Chrome extension messaging from popup to content script Chrome扩展程序使内容脚本能够访问iframe - Chrome extension enable content script to access iframe
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM