From 9dad654fc2afa0ba2699a4611308216668d2b550 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 Nov 2020 12:34:31 +0530 Subject: [PATCH] Register the calibre URL on macOS as well --- bypy/macos/__main__.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bypy/macos/__main__.py b/bypy/macos/__main__.py index 0613daa58f..adc48a5cb9 100644 --- a/bypy/macos/__main__.py +++ b/bypy/macos/__main__.py @@ -403,11 +403,18 @@ class Freeze(object): BOOK_EXTENSIONS = calibre_constants['book_extensions'] env = dict(**ENV) env['CALIBRE_LAUNCHED_FROM_BUNDLE'] = '1' - docs = [{'CFBundleTypeName': 'E-book', - 'CFBundleTypeExtensions': list(BOOK_EXTENSIONS), - 'CFBundleTypeIconFile': 'book.icns', - 'CFBundleTypeRole': 'Viewer', - }] + docs = [{ + 'CFBundleTypeName': 'E-book', + 'CFBundleTypeExtensions': list(BOOK_EXTENSIONS), + 'CFBundleTypeIconFile': 'book.icns', + 'CFBundleTypeRole': 'Viewer', + }] + url_handlers = [dict( + CFBundleTypeRole='Viewer', + CFBundleURLIconFile='calibre', + CFBundleURLName='com.calibre-ebook.calibre-url', + CFBundleURLSchemes=['calibre'] + )] pl = dict( CFBundleDevelopmentRegion='English', @@ -420,6 +427,7 @@ class Freeze(object): CFBundleSignature='????', CFBundleExecutable='calibre', CFBundleDocumentTypes=docs, + CFBundleURLTypes=url_handlers, LSMinimumSystemVersion='10.14.0', LSRequiresNativeExecution=True, NSAppleScriptEnabled=False,