Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
fix: have WebKit ignore all NEW_WINDOW_ACTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
lleyton committed Dec 30, 2023
1 parent 6538839 commit 18b0e0c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ public class SkiffDesktop.MainWindow : He.ApplicationWindow {
.get_navigation_action ()
.get_request ()
.get_uri ();
if (!uri.has_prefix (BASE_URL)) {
policy_decision.ignore ();
if (uri.has_prefix (BASE_URL)) {
policy_decision.use ();
} else {
policy_decision.ignore (); // We shouldn't navigate away from the app.
}
break;
}
Expand All @@ -63,15 +65,17 @@ public class SkiffDesktop.MainWindow : He.ApplicationWindow {
} else {
new Gtk.UriLauncher (uri).launch (this, null, null);
}
policy_decision.ignore (); // Regardless of what happens, we want to handle it, not WebKit.
break;
}
case RESPONSE:
policy_decision.use ();
break;
default:
return false;
return false; // If WebKit adds a new type that we don't know about, just let them handle it.
}

return true;
return true; // Should block the default signal handler... I hope.
}

private void action_about () {
Expand Down

0 comments on commit 18b0e0c

Please sign in to comment.