summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2020-02-24 08:55:26 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2020-02-24 08:55:26 +0000
commit21bbda23fa27561e8f52daff1adb2403c4e86019 (patch)
tree33c529ccf25c4cc31ed877f156edda4019431b08
parent214f436b072e035aa6a53f3c4d62028cd56753fc (diff)
downloadnetsurf-21bbda23fa27561e8f52daff1adb2403c4e86019.tar.gz
netsurf-21bbda23fa27561e8f52daff1adb2403c4e86019.tar.bz2
Browser window: Set the search string on show cookies.
We still need to tell the front end to open the cookies window.
-rw-r--r--desktop/browser_window.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index bdf48b30e..9d8e27605 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -57,6 +57,7 @@
#include "html/box.h"
#include "javascript/js.h"
+#include "desktop/cookie_manager.h"
#include "desktop/browser_history.h"
#include "desktop/browser_private.h"
#include "desktop/download.h"
@@ -4745,8 +4746,19 @@ int browser_window_get_cookie_count(
nserror browser_window_show_cookies(
const struct browser_window *bw)
{
- /** \todo Implement show cookies */
- return NSERROR_OK;
+ nserror err;
+ nsurl *url = browser_window_access_url(bw);
+ lwc_string *host = nsurl_get_component(url, NSURL_HOST);
+ const char *string = (host != NULL) ? lwc_string_data(host) : NULL;
+
+ /** \todo Ensure cookie manager is open. (Ask front end.) */
+
+ err = cookie_manager_set_search_string(string);
+
+ if (host != NULL) {
+ lwc_string_unref(host);
+ }
+ return err;
}
/* Exported interface, documented in browser_window.h */