qutebrowser icon indicating copy to clipboard operation
qutebrowser copied to clipboard

Info.plist: Get rid of deprecated `CFBundleTypeExtensions` / `CFBundleTypeMIMETypes` / `CFBundleTypeOSTypes`

Open The-Compiler opened this issue 3 years ago • 2 comments

We set those for Info.plist, but they seem to be deprecated.

Also see: macOS File and Custom URL Scheme Associations - Free Pascal wiki

The-Compiler avatar Jul 11 '22 09:07 The-Compiler

@The-Compiler Hi there, thanks for this bug report which let me realise what the issue is in the application that I maintain.

tl;dr It looks like the currently in beta macOS Sequoia has finally stopped supporting the deprecated keys in Info.plist so you might need to re-prioritise this ticket. For the record, adding the new keys does not seem to break anything in existing versions.

lighterowl avatar Aug 14 '24 06:08 lighterowl

Thanks for the heads-up!

The-Compiler avatar Aug 14 '24 08:08 The-Compiler

Here's Chromium's Info.plist in full, translated to Python/PyInstaller syntax (thanks ChatGPT!):

{
    'CFBundleDevelopmentRegion': 'en',
    'CFBundleDisplayName': '${EXECUTABLE_NAME}',
    'CFBundleDocumentTypes': [
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "GIF image",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["com.compuserve.gif"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "HTML document",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["public.html"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "XHTML document",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["public.xhtml"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "JavaScript script",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["com.netscape.javascript-source"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "JPEG image",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["public.jpeg"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "MHTML document",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["org.ietf.mhtml"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "HTML5 Audio (Ogg)",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["org.xiph.ogg-audio"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "HTML5 Video (Ogg)",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["org.xiph.ogv"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "PNG image",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["public.png"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "SVG document",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["public.svg-image"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "Plain text document",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["public.text"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "HTML5 Video (WebM)",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["org.webmproject.webm"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "WebP image",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["org.webmproject.webp"]
        },
        {
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["org.chromium.extension"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "PDF Document",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["com.adobe.pdf"]
        },
        {
            "CFBundleTypeIconFile": "document.icns",
            "CFBundleTypeName": "Chromium Shortcut",
            "CFBundleTypeRole": "Viewer",
            "LSItemContentTypes": ["org.chromium.shortcut"]
        },
    ],
    'CFBundleExecutable': '${EXECUTABLE_NAME}',
    'CFBundleIconFile': 'app.icns',
    'CFBundleIdentifier': '${CHROMIUM_BUNDLE_ID}',
    'CFBundleInfoDictionaryVersion': '6.0',
    'CFBundleName': '${CHROMIUM_SHORT_NAME}',
    'CFBundlePackageType': 'APPL',
    'CFBundleSignature': '${CHROMIUM_CREATOR}',
    'NSAppleScriptEnabled': True,
    'OSAScriptingDefinition': 'scripting.sdef',
    'ASWebAuthenticationSessionWebBrowserSupportCapabilities': {
        'IsSupported': True,
        'EphemeralBrowserSessionIsSupported': True,
    },
    'CFBundleURLTypes': [
        {
            "CFBundleURLName": "Web site URL",
            "CFBundleURLSchemes": ["http", "https"]
        },
        {
            "CFBundleURLName": "Local file URL",
            "CFBundleURLSchemes": ["file"]
        },
    ],
    'LSEnvironment': {
        'MallocNanoZone': '0'
    },
    'LSFileQuarantineEnabled': True,
    'LSHasLocalizedDisplayName': '1',
    'LSMinimumSystemVersion': '${CHROMIUM_MIN_SYSTEM_VERSION}',
    'LSRequiresNativeExecution': True,
    'NSCameraReactionEffectGesturesEnabledDefault': False,
    'NSPrincipalClass': 'BrowserCrApplication',
    'NSSupportsAutomaticGraphicsSwitching': True,
    'NSUserActivityTypes': ['NSUserActivityTypeBrowsingWeb'],
    'UTExportedTypeDeclarations': [
        {
            'UTTypeConformsTo': ['public.data', 'public.content'],
            'UTTypeDescription': 'Chromium Extension',
            'UTTypeIdentifier': 'org.chromium.extension',
            'UTTypeTagSpecification': {
                'public.filename-extension': ['crx'],
                'public.mime-type': ['application/x-chrome-extension'],
            }
        },
        {
            'UTTypeConformsTo': ['com.apple.web-internet-location'],
            'UTTypeDescription': 'Chromium Shortcut',
            'UTTypeIdentifier': 'org.chromium.shortcut',
            'UTTypeTagSpecification': {
                'public.filename-extension': ['crwebloc'],
                'public.mime-type': ['application/x-chrome-shortcut'],
            }
        },
    ],
    'UTImportedTypeDeclarations': [
        {
            'UTTypeConformsTo': ['public.data', 'public.content'],
            'UTTypeDescription': 'MIME HTML document',
            'UTTypeIconFile': 'document.icns',
            'UTTypeIdentifier': 'org.ietf.mhtml',
            'UTTypeReferenceURL': 'https://www.ietf.org/rfc/rfc2557',
            'UTTypeTagSpecification': {
                'com.apple.ostype': 'MHTM',
                'public.filename-extension': ['mht', 'mhtml'],
                'public.mime-type': ['multipart/related', 'application/x-mimearchive'],
            }
        },
        {
            'UTTypeConformsTo': ['public.audio'],
            'UTTypeDescription': 'Ogg Audio',
            'UTTypeIconFile': 'document.icns',
            'UTTypeIdentifier': 'org.xiph.ogg-audio',
            'UTTypeReferenceURL': 'https://xiph.org/ogg/',
            'UTTypeTagSpecification': {
                'public.filename-extension': ['ogg', 'oga'],
                'public.mime-type': ['audio/ogg'],
            }
        },
        {
            'UTTypeConformsTo': ['public.movie'],
            'UTTypeDescription': 'Ogg Video',
            'UTTypeIconFile': 'document.icns',
            'UTTypeIdentifier': 'org.xiph.ogv',
            'UTTypeReferenceURL': 'https://xiph.org/ogg/',
            'UTTypeTagSpecification': {
                'public.filename-extension': ['ogm', 'ogv'],
                'public.mime-type': ['video/ogg'],
            }
        },
    ],
    'NSUserNotificationAlertStyle': 'banner',
    'GPUEjectPolicy': 'wait',
    'NSAppTransportSecurity': {
        'NSAllowsArbitraryLoads': True
    },
    'NSBonjourServices': ['_googlecast._tcp'],
}

Other than the crx and crwebloc part, we probably want to copy all the file type handling stuff from them?

I also wonder if there's more to get inspiration from there. Stuff we haven't set, outside of the document type stuff:

{
    'CFBundleDevelopmentRegion': 'en',
    'CFBundleSignature': '${CHROMIUM_CREATOR}',
    'NSAppleScriptEnabled': True,
    'OSAScriptingDefinition': 'scripting.sdef',
    'ASWebAuthenticationSessionWebBrowserSupportCapabilities': {
        'IsSupported': True,
        'EphemeralBrowserSessionIsSupported': True,
    },
    'LSEnvironment': {
        'MallocNanoZone': '0'
    },
    'LSFileQuarantineEnabled': True,
    'LSHasLocalizedDisplayName': '1',
    'LSMinimumSystemVersion': '${CHROMIUM_MIN_SYSTEM_VERSION}',
    'LSRequiresNativeExecution': True,
    'NSCameraReactionEffectGesturesEnabledDefault': False,
    'NSPrincipalClass': 'BrowserCrApplication',
    'NSUserActivityTypes': ['NSUserActivityTypeBrowsingWeb'],
    'NSUserNotificationAlertStyle': 'banner',
    'GPUEjectPolicy': 'wait',
    'NSAppTransportSecurity': {
        'NSAllowsArbitraryLoads': True
    },
    'NSBonjourServices': ['_googlecast._tcp'],
}

The-Compiler avatar Dec 06 '24 20:12 The-Compiler