[Greasemonkey] Parsing whole pages by regex
Aaron Boodman
zboogs at gmail.com
Sat May 27 20:31:10 EDT 2006
On 5/27/06, John Horner <john.horner at gmail.com> wrote:
> 1) is there any reason to do such an entire body.innerHTML replace
> with a function attached to load? It seems to work just the same if
> you simply add the script without it being in a function.
It sounds like you're wondering if
window.addEventListener("load", function() {
document.body.innerHTML = "foo";
}, false);
is the same as:
document.body.innerHTML = "foo";
They are almost the same. The second one will happen a little sooner,
and so there won't be as much flicker (still some, particularly if you
replace the entire document's HTML, as you are). Also, the second one
sometimes crashes the browser, only on some pages. You will have to
test it and see if it does in your case.
> 2) Is there any way to stop the page first loading, then re-loading,
> with this kind of script? I seem to remember tis being discussed
> before, maybe in terms of a future version of GM?
No, sorry.
> The only way to diminish the effect would be to limit the replacement
> to a subsection of the page? Then not all of it would reload?
Right.
- a
More information about the Greasemonkey
mailing list