In the end the solution was to put as much as possible between <script> tags, including html + css, and then it can all be accessed perfectly with 'document.currentScript.innerHTML'. Then I just hard coded the two lines that could not be put inside the tags. All this just to ensure that the updating does not affect the source code in any way :D