From adfa5ca02f388b82e074a0b8a6d7250f76324805 Mon Sep 17 00:00:00 2001 From: Apfelwurm Date: Mon, 4 May 2020 22:06:05 +0200 Subject: [PATCH 1/6] Added manifest for Brave Browser support --- brotab/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brotab/main.py b/brotab/main.py index 8868ef7..d051aab 100644 --- a/brotab/main.py +++ b/brotab/main.py @@ -322,6 +322,8 @@ def install_mediator(args): '~/.config/chromium/NativeMessagingHosts/brotab_mediator.json'), ('mediator/chromium_mediator.json', '~/.config/google-chrome/NativeMessagingHosts/brotab_mediator.json'), + ('mediator/chromium_mediator.json', + '~/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/brotab_mediator.json'), ] if args.tests: @@ -348,7 +350,7 @@ def install_mediator(args): register_native_manifest_windows_chrome(destination) print('Link to Firefox extension: https://addons.mozilla.org/en-US/firefox/addon/brotab/') - print('Link to Chrome (Chromium) extension: https://chrome.google.com/webstore/detail/brotab/mhpeahbikehnfkfnmopaigggliclhmnc/') + print('Link to Chrome (Chromium)/Brave extension: https://chrome.google.com/webstore/detail/brotab/mhpeahbikehnfkfnmopaigggliclhmnc/') def executejs(args): From 722b8d995fed7a71766f007de044a7bdd2d448c1 Mon Sep 17 00:00:00 2001 From: Apfelwurm Date: Tue, 5 May 2020 00:04:10 +0200 Subject: [PATCH 2/6] Added Brave Browser support for Windows --- brotab/main.py | 3 +++ brotab/platform.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/brotab/main.py b/brotab/main.py index d051aab..e1ac56b 100644 --- a/brotab/main.py +++ b/brotab/main.py @@ -69,6 +69,7 @@ from brotab.platform import is_windows from brotab.platform import register_native_manifest_windows_chrome from brotab.platform import register_native_manifest_windows_firefox +from brotab.platform import register_native_manifest_windows_brave from brotab.platform import make_windows_path_double_sep from brotab.utils import split_tab_ids, get_file_size, encode_query from brotab.search.query import query @@ -348,6 +349,8 @@ def install_mediator(args): register_native_manifest_windows_firefox(destination) if is_windows() and 'chrome' in destination: register_native_manifest_windows_chrome(destination) + if is_windows() and 'Brave' in destination: + register_native_manifest_windows_brave(destination) print('Link to Firefox extension: https://addons.mozilla.org/en-US/firefox/addon/brotab/') print('Link to Chrome (Chromium)/Brave extension: https://chrome.google.com/webstore/detail/brotab/mhpeahbikehnfkfnmopaigggliclhmnc/') diff --git a/brotab/platform.py b/brotab/platform.py index 54c9a46..0689653 100644 --- a/brotab/platform.py +++ b/brotab/platform.py @@ -27,6 +27,13 @@ def register_native_manifest_windows_chrome(manifest_filename): print('Setting registry key "%s" to "%s"' % (key_path, manifest_filename)) windows_registry_set_key(key_path, manifest_filename) +def register_native_manifest_windows_brave(manifest_filename): + key_path = r'Software\BraveSoftware\Brave-Browser\NativeMessagingHosts\brotab_mediator' + manifest_filename = make_windows_path(manifest_filename) + logger.info('Setting registry key "%s" to "%s"', key_path, manifest_filename) + print('Setting registry key "%s" to "%s"' % (key_path, manifest_filename)) + windows_registry_set_key(key_path, manifest_filename) + def register_native_manifest_windows_firefox(manifest_filename): key_path = r'Software\Mozilla\NativeMessagingHosts\brotab_mediator' From 2d1e1607a39ed046c4884e4411a73c90e1c98479 Mon Sep 17 00:00:00 2001 From: Apfelwurm Date: Tue, 5 May 2020 01:14:05 +0200 Subject: [PATCH 3/6] added Build, test and manual installation to readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0978587..d1a5531 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,14 @@ Features to show: 1. Install Chrome (Chromium) extension: https://chrome.google.com/webstore/detail/brotab/mhpeahbikehnfkfnmopaigggliclhmnc/ 1. Enjoy! (try `bt clients`, `bt windows`, `bt list`, `bt words`) +## Build, test and manual installation + +1. Install docker: https://docs.docker.com/get-docker/ +1. Install Python3 +1. Clone repository and cd into it +1. Run:```rm -rf ./dist && python3 setup.py sdist bdist_wheel && docker build -t brotab-buildinstallrun . && docker run -it brotab-buildinstallrun``` +1. The build is in the dist folder and can be installed with ```pip install $(find ./dist -name *.whl -type f) ``` + ## Author Yuri Bochkarev From 7afac8d35dbc57ee67e98b94ef3bdf2297eda238 Mon Sep 17 00:00:00 2001 From: Apfelwurm Date: Tue, 5 May 2020 01:16:01 +0200 Subject: [PATCH 4/6] added Build, test and manual installation to DEVELOPMENT.md --- DEVELOPMENT.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index d3ea10d..5f0fb84 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,5 +1,13 @@ # Development +## Build, test and manual installation + +1. Install docker: https://docs.docker.com/get-docker/ +1. Install Python3 +1. Clone repository and cd into it +1. Run:```rm -rf ./dist && python3 setup.py sdist bdist_wheel && docker build -t brotab-buildinstallrun . && docker run -it brotab-buildinstallrun``` +1. The build is in the dist folder and can be installed with ```pip install $(find ./dist -name *.whl -type f) ``` + ## Installation in development mode cd brotab From c58d8f876e0078c843b5e3d07980a5ca66e6d6ba Mon Sep 17 00:00:00 2001 From: Apfelwurm Date: Tue, 5 May 2020 01:17:22 +0200 Subject: [PATCH 5/6] added Brave to readme added Brave to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1a5531..801e680 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Features to show: `sudo pip install brotab`) 1. Install native app manifests: `bt install` 1. Install Firefox extension: https://addons.mozilla.org/en-US/firefox/addon/brotab/ -1. Install Chrome (Chromium) extension: https://chrome.google.com/webstore/detail/brotab/mhpeahbikehnfkfnmopaigggliclhmnc/ +1. Install Chrome (Chromium) / Brave extension: https://chrome.google.com/webstore/detail/brotab/mhpeahbikehnfkfnmopaigggliclhmnc/ 1. Enjoy! (try `bt clients`, `bt windows`, `bt list`, `bt words`) ## Build, test and manual installation From 9ba3599a63eb1c7dd106547c0e49d88b73bc487d Mon Sep 17 00:00:00 2001 From: Apfelwurm Date: Tue, 5 May 2020 01:25:57 +0200 Subject: [PATCH 6/6] linked Build, test and manual installation to DEVELOPMENT.md --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 801e680..bb70bcd 100644 --- a/README.md +++ b/README.md @@ -98,11 +98,7 @@ Features to show: ## Build, test and manual installation -1. Install docker: https://docs.docker.com/get-docker/ -1. Install Python3 -1. Clone repository and cd into it -1. Run:```rm -rf ./dist && python3 setup.py sdist bdist_wheel && docker build -t brotab-buildinstallrun . && docker run -it brotab-buildinstallrun``` -1. The build is in the dist folder and can be installed with ```pip install $(find ./dist -name *.whl -type f) ``` +see [DEVELOPMENT.md](DEVELOPMENT.md) ## Author