Does content_scripts matches “chrome-extension://*/*” work?

后端 未结 4 1377
终归单人心
终归单人心 2020-11-28 15:09

I want to run a content script on an iframe with a chrome-extension:// URL. I added a line to my manifest.json that I copied out of the documentation http://code.google.com/

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 16:00

    You can inject js to your iframe html(chrome-extension: pages) without declaring it in manifast.json. The injected js can visit Chrome APIs directly.

    iframe.html:

    
    
    
    ...
    
    
    ...
    
    
    
    

    iframe.js:

    console.log(chrome); // {loadTimes: ƒ, csi: ƒ, …}
    

提交回复
热议问题