Is it possible to replace HTML, JS and CSS files with Tampermonkey?
These files would be hosted on a server and would just replace the files I want like the index.html, a JS files and the main styles CSS. I could only find how to replace functions of a JS files but not how to replace a file...
This is the only thing i found: (but it's not working)
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://xxx.xx/
// @grant none
// ==/UserScript==
for (var i = document.styleSheets.length - 1; i >= 0; i--) {
document.styleSheets[i].disabled = true;
}
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'http://xx.com/xx/x/x.x.x/xxxx.css';
document.getElementsByTagName("head")[0].appendChild(link);
edit: this works for the css file...but the index.html is not linking to it...
Maybe its not possible :)
Thanks for any help.