Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

web progress?

4 views
Skip to first unread message

miles zarathustra

unread,
Nov 5, 2006, 4:56:24 PM11/5/06
to
Hi all,

Still in pursuit of the simple goal:

be able to give firefox command line arguments which will cause it to load
the specified URL and save the image rendered to the specified file.

So far as I can tell, I will need to write two XPCOM components to get this
to work.

1) to catch the command line arguments
2) to monitor the web page loading progress

My current idea is to write an extension with a XUL page containing a
browser object, and some javascript to :

a) get the desired URL from the command line
b) load the page into the browser object
c) when it's done loading, call the screengrab code to save it to file
d) close the window.

Since the XUL browser object (of course) doesn't have an 'onload' trigger,
so far as I can tell, it looks like if I want to know when it's done
loading, I'll need to add an nsIWebProgressListener to the webProgress
field.

Here's my question:
Is this correct, or is there a simpler way to do it?

<commentary>

BTW, I think I'm making some progress with getting at the command line
arguments, and but the example page on the mozilla dev site seems to not
work at all.

http://developer.mozilla.org/en/docs/Chrome:_Command_Line

I've been engaged with a discussion with Benjamin Smedborg about the
contents of the page.

I think it's unfortunate that this documentation seems to have been written
entirely by programmers who don't need to read it, since the omitted
information has cost me hours needlessly wasted searching the developers
site.

It's also too bad that the site hasn't taken better advantage of wiki
directory structure, because one of the things that renders the help so
blunderingly incoherent is the absence of any cues about context.
Everything seems to be just hung off the main page.

It's not like XPCOM needs any help being incoherent!!


</commentary>


Eric H. Jung

unread,
Nov 6, 2006, 9:22:35 AM11/6/06
to miles zarathustra, dev-ext...@lists.mozilla.org
"Still in pursuit of the simple goal:"

What leads you to believe
this is simple? IMHO, you're using a screwdriver to hammer a nail. Why
not use something like wget (or one of its many variants)--it was
intended from the start to do what you want.

Hi all,

<commentary>

http://developer.mozilla.org/en/docs/Chrome:_Command_Line


</commentary>


_______________________________________________
dev-extensions mailing list
dev-ext...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-extensions

miles zarathustra

unread,
Nov 6, 2006, 2:40:34 PM11/6/06
to
Perhaps I was not clear.

To my knowledge, wget stores the text of the web page. It does not have any
capabilities to render that page graphically.

I need a snapshot of the page itself, as rendered in the browser. I'm
trying to make images of the web page.

I tried konqueror, (via khtml and the preveiw viewer) which even has a
preview-generating engine, but its ability to handle complex layout and
flash seems deficient.

Incidentally, it seems impossible to use the "import" utility from
ImageMagick on firefox, since it does not correctly register its window ID
with X.


Thanks,

-= miles =-

Myk Melez

unread,
Nov 6, 2006, 2:51:35 PM11/6/06
to miles zarathustra
Eric H. Jung wrote:
> "Still in pursuit of the simple goal:"
>
> What leads you to believe
> this is simple? IMHO, you're using a screwdriver to hammer a nail. Why
> not use something like wget (or one of its many variants)--it was
> intended from the start to do what you want.

wget only saves the HTML code, while Miles is trying to save an image
containing the rendered page.

Fortunately, someone has already solved this problem. Unfortunately, I
can't remember the name of the utility. It's a GNOME tool, if I recall
correctly.

Also see this blog post, which talks about the Firefox API for grabbing
an image of a rendered page:

http://weblogs.mozillazine.org/roc/archives/2005/05/rendering_web_p.html

-myk

Nickolay Ponomarev

unread,
Nov 6, 2006, 3:32:51 PM11/6/06
to Myk Melez, dev-ext...@lists.mozilla.org, miles zarathustra
On 11/6/06, Myk Melez <m...@mozilla.org> wrote:
> Also see this blog post, which talks about the Firefox API for grabbing
> an image of a rendered page:
>
> http://weblogs.mozillazine.org/roc/archives/2005/05/rendering_web_p.html
>
Doesn't work with plugins, as mentioned earlier.

Nickolay

Eric H. Jung

unread,
Nov 6, 2006, 9:15:38 PM11/6/06
to dev-ext...@lists.mozilla.org
OK, sorry, I forgot your original goal. In addition to what Myk pointed your to, you might have a look at the source of these extensions:

http://ted.mielczarek.org/code/mozilla/tabpreview/
https://addons.mozilla.org/firefox/2134/
https://addons.mozilla.org/firefox/1457/

They all show graphic thumbnails/previews of webpages like the link Myk sent. One of them (or perhaps another, similar one) was involved with Google Summer of Code this past summer IIRC.


----- Original Message ----
From: miles zarathustra <nob...@nowhere.net>
To: dev-ext...@lists.mozilla.org
Sent: Monday, November 6, 2006 2:40:34 PM
Subject: Re: web progress?

Perhaps I was not clear.

To my knowledge, wget stores the text of the web page. It does not have any
capabilities to render that page graphically.

I need a snapshot of the page itself, as rendered in the browser. I'm
trying to make images of the web page.

I tried konqueror, (via khtml and the preveiw viewer) which even has a
preview-generating engine, but its ability to handle complex layout and
flash seems deficient.

Incidentally, it seems impossible to use the "import" utility from
ImageMagick on firefox, since it does not correctly register its window ID
with X.


Thanks,

-= miles =-

> What leads you to believe


> this is simple? IMHO, you're using a screwdriver to hammer a nail. Why
> not use something like wget (or one of its many variants)--it was
> intended from the start to do what you want.

_______________________________________________

miles zarathustra

unread,
Nov 7, 2006, 12:52:56 AM11/7/06
to
Thanks! I'll have a look.

-= miles =-

0 new messages