Avoid rendering before modifications

Subscribe to Avoid rendering before modifications 6 posts, 4 voices

 
ceth Scriptwright

Hello,

After some search over the forum, it seems this is a greasemonkey limitation. Is it still the case ?

I have wrote my first script (clubic's screenshots) which allows to overide pages presentation by redirecting to the image the pages contains. (fullscreen views of thumbnails)

And the original page is shown a few seconds before the image alone overides it. Not really ennoying as it is quick, but it would be nice if I could avoid the original page to renders.

 
znerp Scriptwright

To the best of my knowledge, Greasemonkey can only run after the page has loaded.

 
Mindeye Scriptwright

Greasemonkey runs the scripts when the DOMContentLoaded event fires. You can read more about it and the flicker you refer in http://wiki.greasespot.net/DOMContentLoaded

 
Yansky Scriptwright

It's not that hard to convert your script to an extension if your script doesn't use any GM api's.

 
ceth Scriptwright

Yansky > I tryied that (using script-compiler), and even converted to an extension I got the same issue. And in fact I would even not call that "flickering" (after translating that word to my language, I understood it refers to "something really brief, barely visible"), as in my case I can see the original page during almost 1sec. (maybe because of the size of the HTLM content in this case, as explained in Mindeye's link)

Mindeye > Thank you for the link ! The "userContent.css and -moz-document()" trick drove me to a working solution (after some tests to figure out why my commands in userContent.css were not working^^). I finally added that code, referring to the pages my script modifies:

{body {background-color: white !important; background-image: none !important;} div#homepagev2 {display:none !important;}}

And the result is almost perfect ! :) I now see a blank page, and then the image comes. Original page is no more rendered. :)

 
Mindeye Scriptwright

Glad to help :-)