📜  将 javascript 注入网页 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:24.960000             🧑  作者: Mango

代码示例1
$.ajax({
    url: `chrome-extension://${chrome.runtime.id}/index.html`,
    success: function(data){ 
        //Simple note: the injected id is there so if you wanted to remove the injection you could do that :D
        document.getElementsByTagName('body').innerHTML += "";
    },
    error: function(err){
        alert(err);
    }
});