use Gtk3 -init; use Gtk3::WebKit2; my ($url) = shift @ARGV || 'http://search.cpan.org/'; my $window = Gtk3::Window->new('toplevel'); $window->set_default_size(800, 600); $window->signal_connect(destroy => sub { Gtk3->main_quit() }); # Create a WebKit widget my $view = Gtk3::WebKit2::WebView->new(); # Load a page $view->load_uri($url); # Pack the widgets together my $scrolls = Gtk3::ScrolledWindow->new(); $scrolls->add($view); $window->add($scrolls); $window->show_all(); Gtk3->main();
The xvfb-run command can do this for you.
With Ubuntu 12.04 LTS, you'll need these (or more recent) extra deb packages:
xvfb libgirepository1.0-dev pkg-config libgtk-3-dev libglib2.0-dev libglib2.0-0 gir1.2-webkit-3.0
At which point everything should ``just work''.
This library is free software; you can redistribute it and/or modify it under the same terms of:
This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You should have received a copy of the GNU Library General Public License along with this module; if not, see <http://www.gnu.org/licenses/>.
For the terms of The Artistic License, see perlartistic.