Re: non-gui usage of Gtk2::MozEmbed
- From: "Tadej BorovÅak" <tadeboro gmail com>
- To: "Nickolay Platonov" <nickolay8 gmail com>
- Cc: gtk-perl-list gnome org
- Subject: Re: non-gui usage of Gtk2::MozEmbed
- Date: Wed, 10 Dec 2008 16:39:10 +0100
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]