Re: non-gui usage of Gtk2::MozEmbed



Ups, seems I was replying to each interlocutor personally, and not via mailing list, sorry..

Currently my progress is: I have a small separate perl script (http://rafb.net/p/IRsq5r59.html) which I'm using to receive an innerHTML of the particularly URL. 
This script works only in presence of X server (you were right Tadej), so I'm using Xvfb (many thanks to Dave for this clue).

But it works differently on my development machine (which is making requests to remote DB) and my production server (on which requests to DB are local).
It seems that for production server the "net_stop" event occurs a bit early - when the page is not fully complete yet.

It seems I'll need to replace the "net_stop" event to some kind of custom _javascript_ event, like described here:
https://developer.mozilla.org/En/Mozilla_Embedding_FAQ/How_do_I...
( "I need the _javascript_ inside the browser window to talk to my embedding client. How do I do it?" section)

Many thanks to everyone for the help already provided..

Regards, Nickolay

On Wed, Dec 10, 2008 at 6:39 PM, Tadej Borovšak <tadeboro gmail com> wrote:
Hi.

I'm guessing now, but what happens if you call realize method on your
embed object?


2008/12/10 Nickolay Platonov <nickolay8 gmail com>:
> Hello,
>
> Can someone please advise me on Gtk2::MozEmbed - can I use it in
> "standalone" way, without adding to window?
> I'm experimenting with simpliest case, like here:
>
> #!/usr/bin/perl
>
>
> use Glib qw(TRUE FALSE);
> use Gtk2 -init;
> use Gtk2::MozEmbed '0.04';
> use Mozilla::DOM '0.18';   # for NSHTMLElement
>
>
>
> my $embed = Gtk2::MozEmbed->new();
>
> $embed->signal_connect(net_stop => sub {
>
>     print "Callback called";
>     Gtk2->main_quit;
>     return FALSE;
> });
>
>
> $embed->load_url("http://ya.ru");
>
> print "Starting mainloop\n";
>
> Gtk2->main();
>
> and it seems the callback is never get called, meanwhile this variant works:
>
> #!/usr/bin/perl
>
>
> use Glib qw(TRUE FALSE);
> use Gtk2 -init;
> use Gtk2::MozEmbed '0.04';
> use Mozilla::DOM '0.18';   # for NSHTMLElement
>
> my $window = Gtk2::Window->new ('toplevel');
> my $embed = Gtk2::MozEmbed->new();
>
> $embed->signal_connect(net_stop => sub {
>       print "Callback called";
>     Gtk2->main_quit;
>     return FALSE;
> });
>
> $embed->load_url("http://ya.ru");
>
> print "Starting mainloop\n";
>
> $window->add($embed);
> $window->show_all;
>
> Gtk2->main();
>
> I'm trying to create a server-side rendering service for search-engines
> spiders, which cannot execute _javascript_. And I need to somehow extract
> innerHTML of the page (including html produced by _javascript_) in "non-gui"
> way, in the web-application's controller.
>
> Best regards, Nickolay
>
> _______________________________________________
> gtk-perl-list mailing list
> gtk-perl-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-perl-list
>
>



--
Tadej Borovšak
00386 (0)40 613 131
tadeboro gmail com
tadej borovsak gmail com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]