From 7510cb2d208665280153dc11e690ea2b3c6c31b3 Mon Sep 17 00:00:00 2001 From: Graham Perrin Date: Sun, 1 Mar 2020 17:28:04 +0000 Subject: [PATCH 1/5] Update open_with_linux.py Aiming to fix https://github.com/darktrojan/openwith/issues/250 * focusing first on Linux --- webextension/native/open_with_linux.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webextension/native/open_with_linux.py b/webextension/native/open_with_linux.py index fe1dbec..d4f8ee7 100755 --- a/webextension/native/open_with_linux.py +++ b/webextension/native/open_with_linux.py @@ -62,9 +62,11 @@ def install(): 'type': 'stdio', } locations = { + 'brave': os.path.join(home_path, '.config', 'BraveSoftware', 'Brave-Browser-Dev', 'NativeMessagingHosts'), 'chrome': os.path.join(home_path, '.config', 'google-chrome', 'NativeMessagingHosts'), 'chromium': os.path.join(home_path, '.config', 'chromium', 'NativeMessagingHosts'), 'firefox': os.path.join(home_path, '.mozilla', 'native-messaging-hosts'), + 'waterfox-current': os.path.join(home_path, '.waterfox', 'native-messaging-hosts'), } filename = 'open_with.json' @@ -112,6 +114,9 @@ def _read_desktop_file(path): def find_browsers(): apps = [ + 'brave', + 'brave-browser', + 'brave-browser-dev', 'Chrome', 'Chromium', 'chromium-browser', @@ -123,6 +128,7 @@ def find_browsers(): 'Opera', 'SeaMonkey', 'seamonkey', + 'Waterfox Current', ] paths = [ os.path.join(os.getenv('HOME'), '.local/share/applications'), From 44556ba78d08a691d2b7eed2dd532ebae2db8074 Mon Sep 17 00:00:00 2001 From: Graham Perrin Date: Sun, 1 Mar 2020 22:53:01 +0000 Subject: [PATCH 2/5] Update open_with_linux.py Addition of `waterfox-current` re: https://github.com/darktrojan/openwith/issues/250#issuecomment-593125429 --- webextension/native/open_with_linux.py | 1 + 1 file changed, 1 insertion(+) diff --git a/webextension/native/open_with_linux.py b/webextension/native/open_with_linux.py index d4f8ee7..31707a6 100755 --- a/webextension/native/open_with_linux.py +++ b/webextension/native/open_with_linux.py @@ -129,6 +129,7 @@ def find_browsers(): 'SeaMonkey', 'seamonkey', 'Waterfox Current', + 'waterfox-current', ] paths = [ os.path.join(os.getenv('HOME'), '.local/share/applications'), From 80673c763dff12a78e7727326facc483aae1eee3 Mon Sep 17 00:00:00 2001 From: Graham Perrin Date: Sun, 1 Mar 2020 23:09:19 +0000 Subject: [PATCH 3/5] Update open_with_linux.py --- webextension/native/open_with_linux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webextension/native/open_with_linux.py b/webextension/native/open_with_linux.py index 31707a6..0145d2c 100755 --- a/webextension/native/open_with_linux.py +++ b/webextension/native/open_with_linux.py @@ -76,7 +76,7 @@ def install(): os.mkdir(location) browser_manifest = manifest.copy() - if browser == 'firefox': + if browser == 'firefox' or browser == 'waterfox-current': browser_manifest['allowed_extensions'] = ['openwith@darktrojan.net'] else: browser_manifest['allowed_origins'] = [ From 559c69b026e6c784598a45a30565ca6e870e95ec Mon Sep 17 00:00:00 2001 From: Graham Perrin Date: Sun, 1 Mar 2020 23:25:22 +0000 Subject: [PATCH 4/5] Aim to add support for Brave and Waterfox Current NB **some guesswork** because I don't have a Mac on which to test. --- webextension/native/open_with_mac.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webextension/native/open_with_mac.py b/webextension/native/open_with_mac.py index 075d985..4c4ca72 100755 --- a/webextension/native/open_with_mac.py +++ b/webextension/native/open_with_mac.py @@ -62,9 +62,11 @@ def install(): 'type': 'stdio', } locations = { + 'brave': os.path.join(home_path, 'Library', 'Application Support', 'BraveSoftware', 'Brave-Browser-Dev', 'NativeMessagingHosts'), 'chrome': os.path.join(home_path, 'Library', 'Application Support', 'Google', 'Chrome', 'NativeMessagingHosts'), 'chromium': os.path.join(home_path, 'Library', 'Application Support', 'Chromium', 'NativeMessagingHosts'), 'firefox': os.path.join(home_path, 'Library', 'Application Support', 'Mozilla', 'NativeMessagingHosts'), + 'waterfox-current': os.path.join(home_path, 'Library', 'Application Support', 'Waterfox', 'NativeMessagingHosts'), } filename = 'open_with.json' @@ -74,7 +76,7 @@ def install(): os.mkdir(location) browser_manifest = manifest.copy() - if browser == 'firefox': + if browser == 'firefox' or browser == 'waterfox-current': browser_manifest['allowed_extensions'] = ['openwith@darktrojan.net'] else: browser_manifest['allowed_origins'] = [ @@ -90,6 +92,7 @@ def install(): def find_browsers(): apps = [ + 'Brave', 'Chrome', 'Chromium', 'Firefox', @@ -97,6 +100,7 @@ def find_browsers(): 'Opera', 'Safari', 'SeaMonkey', + 'Waterfox Current', ] paths = [ os.path.join(os.getenv('HOME'), 'Applications'), From 8a6c148dc88e29317766095bfa8bae6894fd4284 Mon Sep 17 00:00:00 2001 From: Graham Perrin Date: Mon, 2 Mar 2020 00:36:15 +0000 Subject: [PATCH 5/5] Aim to add support for Brave and Waterfox Current MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NB **much guesswork**: * I'm not a developer * Microsoft Windows is complicated to me (I normally use FreeBSD-CURRENT) – it will be good if someone else can test and correct this code. --- webextension/native/open_with_windows.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webextension/native/open_with_windows.py b/webextension/native/open_with_windows.py index 8f56cac..daed922 100644 --- a/webextension/native/open_with_windows.py +++ b/webextension/native/open_with_windows.py @@ -73,13 +73,15 @@ def install(): file.write('@echo off\r\ncall "%s" "%s" %%1 %%2\r\n' % (sys.executable, this_file)) registry_locations = { + 'brave': os.path.join('Software', 'BraveSoftware', 'Brave-Browser-Dev', 'NativeMessagingHosts'), 'chrome': os.path.join('Software', 'Google', 'Chrome', 'NativeMessagingHosts'), 'firefox': os.path.join('Software', 'Mozilla', 'NativeMessagingHosts'), + 'waterfox-current': os.path.join('Software', 'Waterfox', 'Waterfox Current 68.0', 'NativeMessagingHosts'), } for browser, registry_location in registry_locations.items(): browser_manifest = manifest.copy() - if browser == 'firefox': + if browser == 'firefox' or browser == 'waterfox-current': browser_manifest['allowed_extensions'] = ['openwith@darktrojan.net'] else: browser_manifest['allowed_origins'] = [