Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

inject javascript to webpage

$.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 += "<script id='injected'>" + data + "</script>";
    },
    error: function(err){
        alert(err);
    }
});
 
PREVIOUS NEXT
Tagged: #inject #javascript #webpage
ADD COMMENT
Topic
Name
9+9 =