I want to call a remote JavaScript code which is located in GitHub (raw version), from my web browser’s user script manager (Tampermonkey).
The JavaScript code on GitHub was already tested locally (by copy-pasting it into the browser’s console and executing it) and is working.
I tried to call the remote script this way:
var githubScript = document.createElement('script');
script.type = 'text/javascript';
script.src = 'GITHUB_URL';
document.head.appendChild(githubScript);
But, the only output I get in console is the file itself (i.e. no execution of the actual code in the file occurs).
Please suggest what have I done wrong (perhaps I lack a command to actually run the code?).