/usr/share/doc/libgtk3-webkit2-perl/examples/browser.pl is in libgtk3-webkit2-perl 0.06-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/bin/env perl
=head1 NAME
browser.pl - Embed a webkit widget in an application
=head1 SYNOPSIS
browser.pl [URL]
Simple usage:
browser.pl http://search.cpan.org/
=head1 DESCRIPTION
Display a web page.
=cut
use strict;
use warnings;
use Gtk3 -init;
use Gtk3::WebKit2;
sub main {
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 WebKit2 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();
return 0;
}
exit main() unless caller;
|