diff --git a/Inject-JavaScript-Code.md b/Inject-JavaScript-Code.md index 02a812d..6f0adef 100644 --- a/Inject-JavaScript-Code.md +++ b/Inject-JavaScript-Code.md @@ -4,4 +4,22 @@ For example, some users want to make an Auto Refresh every X time because the se ```javascript setInterval(function(){location.reload();}, 600000); -``` \ No newline at end of file +``` + +An other example is injecting custom CSS (user styles). +This can be done with following snippet: + +```javascript +(()=>{ let css=` +/* START OF STYLE */ + +* { + color: red; +} + +/* END OF STYLE */ +`; + +var ss = document.createElement("style"); +ss.type = "text/css"; ss.innerHTML = css; +document.getElementsByTagName("head")[0].appendChild(ss); })();``` \ No newline at end of file