Skip to content

Commit fc8783b

Browse files
authored
Merge pull request #79 from sorryforthecommit/decide_policy_ignore_about_blanks
Decide policy ignore about:blank
2 parents a94651a + 8940935 commit fc8783b

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ Change to how page loading is checked in fire events.
3232

3333
0.125 Mon Oct 5 13:15 CET 2020
3434
- allow multiple concurrent navigations (can be caused by iframes) and turn die into opt-in warn
35+
36+
0.126 Tue Oct 6 11:00 CET 2020
37+
- navigation requests to about:blank never properly finish and cause WebKit to hang

lib/WWW/WebKit2.pm

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ use X11::Xlib;
5353
use Carp qw(carp croak);
5454
use XSLoader;
5555
use English '-no_match_vars';
56-
use POSIX qw<F_SETFD F_GETFD FD_CLOEXEC>;
56+
use POSIX qw(F_SETFD F_GETFD FD_CLOEXEC);
5757

58-
our $VERSION = '0.125';
58+
our $VERSION = '0.126';
5959

6060
use constant DOM_TYPE_ELEMENT => 1;
6161
use constant ORDERED_NODE_SNAPSHOT_TYPE => 7;
@@ -355,23 +355,29 @@ sub init_webkit {
355355

356356
$self->view->signal_connect('decide-policy' => sub {
357357
my ($view, $decision, $type) = @_;
358+
358359
if ($type eq 'navigation-action') {
360+
359361
my $action = $decision->get_navigation_action;
362+
my $action_uri = $action->get_request->get_uri;
360363

361-
if ($self->concurrent_active_navigation_warning
362-
and $self->active_navigation_action and not $action->is_redirect) {
364+
unless ($action_uri eq 'about:blank') {
363365

364-
warn "Already running a navigation action to " .
365-
$self->active_navigation_action
366-
. " when requested "
367-
. $action->get_navigation_type . ' ' . $action->get_request->get_uri;
368-
}
366+
if ($self->concurrent_active_navigation_warning
367+
and $self->active_navigation_action and not $action->is_redirect) {
369368

370-
$self->active_navigation_action($action->get_request->get_uri)
371-
if ($self->view->get_uri =~ s/#.*//r) ne ($action->get_request->get_uri =~ s/#.*//r)
372-
and not $action->is_redirect;
369+
warn "Already running a navigation action to " .
370+
$self->active_navigation_action
371+
. " when requested "
372+
. $action->get_navigation_type . ' ' . $action->get_request->get_uri;
373+
}
373374

375+
$self->active_navigation_action($action->get_request->get_uri)
376+
if ($self->view->get_uri =~ s/#.*//r) ne ($action->get_request->get_uri =~ s/#.*//r)
377+
and not $action->is_redirect;
378+
}
374379
}
380+
375381
$decision->use;
376382
return 0;
377383
});

0 commit comments

Comments
 (0)