Inject HTML into a page from a content script

后端 未结 5 1748
南旧
南旧 2020-11-28 23:35

I am building a Chrome Extension and I have a requirement to overlay a blob of html on top of a few websites. At the moment I am using a JQuery .Get to pull the

5条回答
  •  野性不改
    2020-11-29 00:21

    I use this code. It's only 3 lines of code and you don't need any jquery's garbage.

    var iframe  = document.createElement ('iframe');
    iframe.src  = chrome.extension.getURL ('iframe.html');
    document.body.appendChild (iframe);
    

提交回复
热议问题