Skip to content

Commit 5d1810e

Browse files
committed
Disregard all about:<something> uris in the navigation policy.
We already discovered issues with about:blank requests, as these are not regular navigation requests. These peculiarities extend to other about: requests as well, so they should be disregarded in the decide-policy handling too.
1 parent fc8783b commit 5d1810e

3 files changed

Lines changed: 45 additions & 2 deletions

File tree

lib/WWW/WebKit2.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ sub init_webkit {
361361
my $action = $decision->get_navigation_action;
362362
my $action_uri = $action->get_request->get_uri;
363363

364-
unless ($action_uri eq 'about:blank') {
365-
364+
unless ($action_uri =~ m/about:\w+$/) {
366365
if ($self->concurrent_active_navigation_warning
367366
and $self->active_navigation_action and not $action->is_redirect) {
368367

t/iframe_open.t

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use strict;
2+
use warnings;
3+
use utf8;
4+
5+
use Test::More;
6+
use lib 'lib';
7+
use FindBin qw($Bin $RealBin);
8+
use lib "$Bin/../../Gtk3-WebKit2/lib";
9+
use URI;
10+
use WWW::WebKit2;
11+
12+
#Running tests as root will sometimes spawn an X11 that cannot be closed automatically and leave the test hanging
13+
plan skip_all => 'Tests run as root may hang due to X11 server not closing.' unless $>;
14+
15+
my $wkit = WWW::WebKit2->new(xvfb => 1);
16+
$wkit->init;
17+
18+
$wkit->open("$Bin/test/iframe.html");
19+
ok(1, 'opened');
20+
21+
done_testing;

t/test/iframe.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
iframe {
6+
width: 200px;
7+
height: 200px;
8+
}
9+
</style>
10+
11+
<script>
12+
</script>
13+
</head>
14+
<body>
15+
16+
<div>beautiful testpage</div>
17+
18+
<iframe src="about:blank"></iframe>
19+
<iframe src="about:help"></iframe>
20+
<iframe src="about:config"></iframe>
21+
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)