在自己的html中可以加载chrome的扩展吗,就是普通的html,不是popup

在自己的html中可以加载chrome的扩展吗,就是普通的html,不是popup

manifest.json配置里面的"js"这个配置就是扩展插入到html页面的js代码,自己用ajax加载内容或者输出iframe到你的页面就行了,不一定要popup

chrome扩展获取页面dom对象信息

     {
      "js": ["myjs.js"]}],
      "permissions": ["*://*/*","tabs"]
            //..........其他配置
    }

myjs.js


window.onload = function () {
    alert(location.href);
    var t = document.createElement('input'); t.style.cssText = 'width:100%;height:25px;'; document.body.appendChild(t);
};