From 9ae707f0217070307868121d12e801ea4aa68ece Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 10 Jul 2024 11:44:34 +0300 Subject: [PATCH] prevent signal propagation --- .../Browser/Container/Page/Content/Data.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Entity/Browser/Container/Page/Content/Data.php b/src/Entity/Browser/Container/Page/Content/Data.php index 3a0b071..74d10c7 100644 --- a/src/Entity/Browser/Container/Page/Content/Data.php +++ b/src/Entity/Browser/Container/Page/Content/Data.php @@ -60,13 +60,33 @@ class Data \GtkLabel $label, string $href ) { + // Format URL + $url = $this->_url( + $href + ); + + // Update request entry $this->content->page->navbar->request->setValue( $this->_url( $href ) ); + // Update page $this->content->page->update(); + + // Prevent propagation for supported protocols + if (in_array( + parse_url( + $url, + PHP_URL_SCHEME + ), + [ + 'nex', + 'gemini', + 'file' + ]) + ) return true; } ); }