[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sun, 20 Mar 2022 04:54:57 -0400 (EDT) |
branch: master
commit 29c1b05471d1512d44c0bfc3fce6f41d1aef97db
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun May 5 18:03:15 2019 +0100
make n key work more than once
---
js/wkinfo/extension.c | 17 +++--------------
js/wkinfo/main.c | 8 +++++++-
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/js/wkinfo/extension.c b/js/wkinfo/extension.c
index ff5460e5d1..122c6fbc85 100644
--- a/js/wkinfo/extension.c
+++ b/js/wkinfo/extension.c
@@ -36,19 +36,10 @@ request_callback (WebKitWebPage *web_page,
{
const char *uri = webkit_uri_request_get_uri (request);
- g_print ("Intercepting link <%s>\n", uri);
+ // g_print ("Intercepting link <%s>\n", uri);
+
+ /* Could block external links here */
- if (!strcmp (uri, "internal:next"))
- {
- if (next_link)
- {
- g_print ("redirect to |%s|\n", next_link);
-
- webkit_uri_request_set_uri (request, next_link);
- /* This doesn't work as webkit_web_page_get_uri still
- returns "internal:next". */
- }
- }
return false;
}
@@ -114,7 +105,6 @@ document_loaded_callback (WebKitWebPage *web_page,
}
if (rel && href)
{
- g_print ("rel:href is |%s:%s|\n", rel, href);
if (!strcmp (rel, "next"))
{
free (next_link); next_link = 0;
@@ -139,7 +129,6 @@ document_loaded_callback (WebKitWebPage *web_page,
strcpy (next_link + (p - current_uri), href);
g_print ("saved ref |%s|\n", next_link);
-
ssize_t result;
result = sendto (socket_id, next_link,
strlen (next_link), 0,
diff --git a/js/wkinfo/main.c b/js/wkinfo/main.c
index fd6c6cd964..02f1c6d3a2 100644
--- a/js/wkinfo/main.c
+++ b/js/wkinfo/main.c
@@ -30,6 +30,8 @@ remove_socket (void)
unlink (socket_file);
}
+static char *next_link;
+
gboolean
socket_cb (GSocket *socket,
GIOCondition condition,
@@ -50,6 +52,9 @@ socket_cb (GSocket *socket,
}
g_print ("Received le data: <%s>\n", buffer);
+ buffer[255] = '\0';
+ free (next_link);
+ next_link = strdup (buffer);
break;
case G_IO_ERR:
@@ -179,7 +184,8 @@ static gboolean onkeypress(GtkWidget *webView,
gtk_main_quit();
break;
case GDK_KEY_n:
- webkit_web_view_load_uri(WEBKIT_WEB_VIEW(webView), "internal:next");
+ webkit_web_view_load_uri(WEBKIT_WEB_VIEW(webView),
+ next_link);
break;
default:
;
- master updated (cd0de30b76 -> ca0de032c7), Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20