Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们为我们的组织创建了一个内部机器人,是否可以使用 chrome 扩展在网页右下角的所有网站中启用它。
我探索了一下,但没有找到任何东西,是否有可能做到这一点,或者我们应该寻找其他替代品,而不是使用 chrome 扩展
对的,这是可能的。首先,您可以依靠清单文件通过匹配到*://*/*. 您的另一个选择是从您的后台脚本中以编程方式插入,为此一种可能的方法是在您的后台脚本中创建一个侦听器,chrome.tabs.onCreated然后chrome.tabs.onUpdated在此侦听器中插入此代码chrome.tabs.executeScript(tabId, {file: "your_web_bot_code.js", allFrames: true, runAt: "document_end"});
*://*/*
chrome.tabs.onCreated
chrome.tabs.onUpdated
chrome.tabs.executeScript(tabId, {file: "your_web_bot_code.js", allFrames: true, runAt: "document_end"});