From 1598bd5623024afcb285a3f918f34b13fe5bece2 Mon Sep 17 00:00:00 2001 From: "Mingde (Matthew) Zeng" Date: Wed, 19 Feb 2020 12:38:02 -0500 Subject: [PATCH 1/2] Use eaf-open-browser-with-history instead. --- core/browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/browser.py b/core/browser.py index 3d892ba..e4a446e 100644 --- a/core/browser.py +++ b/core/browser.py @@ -579,7 +579,7 @@ class BrowserBuffer(Buffer): @insert_or_do def insert_or_open_url(self): - self.eval_in_emacs.emit('''(call-interactively 'eaf-open-browser)''') + self.eval_in_emacs.emit('''(call-interactively 'eaf-open-browser-with-history)''') def select_all_or_input_text(self): if self.is_focus(): From a6e3462cd0119a6c2019fb3546dea76b45214114 Mon Sep 17 00:00:00 2001 From: "Mingde (Matthew) Zeng" Date: Wed, 19 Feb 2020 16:04:30 -0500 Subject: [PATCH 2/2] Fix about:blank url error --- core/browser.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/browser.py b/core/browser.py index e4a446e..8f2a46e 100644 --- a/core/browser.py +++ b/core/browser.py @@ -485,12 +485,13 @@ class BrowserBuffer(Buffer): return self.buffer_widget.get_focus_text() != None def record_history(self, new_title): - if self.arguments != "temp_html_file" and new_title != "about:blank" and self.emacs_var_dict["eaf-browser-remember-history"] == "true": + new_url = self.buffer_widget.filter_url(self.buffer_widget.url().toString()) + if self.arguments != "temp_html_file" and new_title != "about:blank" and new_url != "about:blank" and \ + self.emacs_var_dict["eaf-browser-remember-history"] == "true": touch(self.history_log_file_path) with open(self.history_log_file_path, "r") as f: lines = f.readlines() - new_url = self.buffer_widget.filter_url(self.buffer_widget.url().toString()) with open(self.history_log_file_path, "w") as f: for line in lines: line_match = re.match(self.history_url_pattern, line) @@ -501,9 +502,9 @@ class BrowserBuffer(Buffer): title = "" url = line - short_url = re.match(self.short_url_pattern, url) short_new_url = re.match(self.short_url_pattern, new_url) - if short_url != None and short_new_url != None and short_url.group(1) != short_new_url.group(1): + short_url = re.match(self.short_url_pattern, url) + if (short_new_url != None and short_url != None and short_url.group(1) != short_new_url.group(1)): f.write(line) f.write(new_title + " " + new_url + "\n")