Created
February 6, 2018 07:10
-
-
Save joonahn/cafbea9beed7b046131511810b69da33 to your computer and use it in GitHub Desktop.
inject script with tampermonkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http://targetsite.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
console.log("asdf"); | |
(function(d, script) { | |
script = d.createElement('script'); | |
script.type = 'text/javascript'; | |
script.async = true; | |
script.onload = function(){ | |
// remote script has loaded | |
}; | |
script.src = 'http://yoursite.com/script.js'; | |
d.getElementsByTagName('head')[0].appendChild(script); | |
}(document)); | |
// Your code here... | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment