summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-16 08:33:35 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-16 08:33:35 +0200
commita50a01da45a8fb6a4d6ee419fc1ad240b1f0dee5 (patch)
treea9ad9bd8259034a95049f5432599b8497613dd32 /src/ui
parent25a3f4fc680fbfd5acdd77361194cd6a2244c8cc (diff)
Remember redirected URLs as visited
"visited.txt" will now remember URLs that were redirects, but those are not shown in the UI as part of the history. This fixes the issue where redirected URLs were not being shown as visited links in the UI. Beware if downgrading Lagrange: URLs in the history will get prefixed with "0000 ". Might be a good idea to switch to a forwards compatible format like JSON for these files.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/documentwidget.c2
-rw-r--r--src/ui/window.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 3fc7e841..40f34db4 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
41#include "scrollwidget.h" 41#include "scrollwidget.h"
42#include "util.h" 42#include "util.h"
43#include "visbuf.h" 43#include "visbuf.h"
44#include "visited.h"
44 45
45#include <the_Foundation/file.h> 46#include <the_Foundation/file.h>
46#include <the_Foundation/fileinfo.h> 47#include <the_Foundation/fileinfo.h>
@@ -1051,6 +1052,7 @@ static void checkResponse_DocumentWidget_(iDocumentWidget *d) {
1051 else if (equalCase_Rangecc(urlScheme_String(dstUrl), 1052 else if (equalCase_Rangecc(urlScheme_String(dstUrl),
1052 cstr_Rangecc(urlScheme_String(d->mod.url)))) { 1053 cstr_Rangecc(urlScheme_String(d->mod.url)))) {
1053 /* Redirects with the same scheme are automatic. */ 1054 /* Redirects with the same scheme are automatic. */
1055 visitUrl_Visited(visited_App(), d->mod.url, transient_VisitedUrlFlag);
1054 postCommandf_App( 1056 postCommandf_App(
1055 "open redirect:%d url:%s", d->redirectCount + 1, cstr_String(dstUrl)); 1057 "open redirect:%d url:%s", d->redirectCount + 1, cstr_String(dstUrl));
1056 } 1058 }
diff --git a/src/ui/window.c b/src/ui/window.c
index a69dd7db..ba6ee869 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -254,7 +254,7 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
254 if (equal_Command(cmd, "document.changed")) { 254 if (equal_Command(cmd, "document.changed")) {
255 iInputWidget *url = findWidget_App("url"); 255 iInputWidget *url = findWidget_App("url");
256 const iString *urlStr = collect_String(suffix_Command(cmd, "url")); 256 const iString *urlStr = collect_String(suffix_Command(cmd, "url"));
257 visitUrl_Visited(visited_App(), urlStr); 257 visitUrl_Visited(visited_App(), urlStr, 0);
258 postCommand_App("visited.changed"); /* sidebar will update */ 258 postCommand_App("visited.changed"); /* sidebar will update */
259 setText_InputWidget(url, urlStr); 259 setText_InputWidget(url, urlStr);
260 updateTextCStr_LabelWidget(reloadButton, reloadCStr_); 260 updateTextCStr_LabelWidget(reloadButton, reloadCStr_);