From 96c2e47ec3258d35a2d7bc642db9f8334a6dcd0d Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Thu, 14 Jan 2021 11:53:49 -0500 Subject: [PATCH] Add provider for chromium based edge bookmarks --- Bookmarks/bookmarks.ini | 18 ++++++++++++++++++ Bookmarks/providers/__init__.py | 1 + Bookmarks/providers/edge.py | 15 +++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 Bookmarks/providers/edge.py diff --git a/Bookmarks/bookmarks.ini b/Bookmarks/bookmarks.ini index fb9713e..c5360dd 100644 --- a/Bookmarks/bookmarks.ini +++ b/Bookmarks/bookmarks.ini @@ -105,6 +105,24 @@ #bookmarks_files = +[provider/Edge] +# Should bookmarks from the Edge browser be referenced? +# Default: yes +#enable = yes + +# By default, this provider will scan the directory(ies) known to be the one +# that are used by this browser to store your bookmarks. However, since this +# detection mechanism is not based on rocket science and given that that browser +# may evolve and change the location of its user data, it is possible to +# manually specify the location of the "Bookmarks" file, used by this browser to +# store your bookmarks. +# * Expected value: the full path to the "Bookmarks" file. This setting accepts +# multi-line value so you may specify several "Bookmarks" files (one per +# line); which don't have to be named "Bookmarks". +# * Default: empty, which means you want to rely on automatic detection +#bookmarks_files = + + [provider/Falkon] # Should bookmarks from the Falkon browser be referenced? # Default: yes diff --git a/Bookmarks/providers/__init__.py b/Bookmarks/providers/__init__.py index 56e0502..c184419 100644 --- a/Bookmarks/providers/__init__.py +++ b/Bookmarks/providers/__init__.py @@ -2,6 +2,7 @@ from ._base import Bookmark from .chrome import ChromeProvider, ChromeCanaryProvider, ChromiumProvider +from .edge import EdgeProvider from .falkon import FalkonProvider from .firefox import FirefoxProvider from .iexplorer import InternetExplorerProvider diff --git a/Bookmarks/providers/edge.py b/Bookmarks/providers/edge.py new file mode 100644 index 0000000..50ca98d --- /dev/null +++ b/Bookmarks/providers/edge.py @@ -0,0 +1,15 @@ +# Keypirinha: a fast launcher for Windows (keypirinha.com) + +import os.path +from .chrome import ChromeProviderBase + +class EdgeProvider(ChromeProviderBase): + def __init__(self, *args): + super().__init__(*args) + + def profile_dir_candidates(self): + candidates = [] + if self.localappdata_dir: + candidates.append(os.path.join( + self.localappdata_dir, "Microsoft", "Edge", "User Data")) + return candidates