我正在尝试使用扩展程序将一些额外的代码插入到 chrome 中的当前标签页中 即在页面顶部添加一个提交按钮。这是去哪里?我将如何像这样初始化每个页面?
最佳答案
如果你把它放在你的 manifest.json
中,
"content_scripts": [{
"matches": ["<all_urls>"],
"js": ["example.js"],
"css": ["example.css"]
}]
然后 example.js
和 example.css
将被注入(inject)到您访问的每个页面中。参见 http://code.google.com/chrome/extensions/content_scripts.html获取更多信息。
关于google-chrome - 通过 chrome 扩展程序将 html 插入当前选项卡?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7632962/