0

If I wanted to change a website's content after its DOM loaded, that would be a fairly straightforward task using Greasemonkey. However, I want to (or, in fact, have to) do a replacement BEFORE the DOM has loaded (inbetween the response and the time firefox starts to parse it). So far, writing an add-on seems to be the only viable option for me, but that seems to be an overkill, and I don't really know how to do it that way. Is there an easier (and less overkill-ish) option, and if not, how (some hints should probably be enough) can I accomplish it with an addon?

  • at what point does your script gets loaded? are you talking about any random website or your own? – vsync Mar 26 '15 at 19:24
  • I want my script to be loaded before the DOM, because I want to modify a script on a website, which is a random website not really maintained anymore, and the script on the said website occasionally bugs out, and this can be solved by a simple string replace of \n to \\n. – foo bar bar foo Mar 26 '15 at 19:27
  • what string replacement, where? in JS? HTML? Never heard of such an attempt to inject a js file and run it before any others on a given webpage..your title has absolutely nothing to do with the problem here. it should be something like - "how to force-run code before everything else on any webpage" – vsync Mar 27 '15 at 12:32

0 Answers0