Post

Replies

Boosts

Views

Activity

Reply to Sending messages from Google Chrome extension to macOS app
I was able to set up the Native Messaging https://developer.chrome.com/docs/apps/nativeMessaging But there is a catch: In order for the messaging to work, i need to create a json here (referencing an executable intended to listen to messages from an extension): $HOME/Library/Application\ Support/Google/Chrome/NativeMessagingHosts. https://developer.chrome.com/docs/apps/nativeMessaging#native-messaging-host-location Unfortunately you can not bundle it with a Chrome plugin so it automatically gets added there. Basically the json looks like this: { "name": "com.kopyl.tabfidnder.nativehost", "description": "Tab Finder Chrome", "path": "/usr/local/bin/native_host.py", "type": "stdio", "allowed_origins": [ "chrome-extension://jcbclkhailmoenaeddooicbemefilmje/" ] } (for rapid prototyping i used Python, but eventually i guess it would be better to utilize an XPC service) Of course i could make a .pkg installer which would add that json config to the file system, but in terms of user experience i don't think it's optimal. And i doubt App Store will approve an application which requires external installations for it to work properly. I tried copying the json on macOS app launch, but with enabled App Sandboxing Entitlement, the path turns to this (and hence becomes invalid): $HOME/Library/Containers/kopyl.tab-finder-chrome-app/Data/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.kopyl.tabfidnder.nativehost.json Without the App Sandboxing the macOS app can't be published to the App Store.
2d
Reply to How to trigger Safari App Extension with a keyboard shortcut without a content script and Accessibility permissions?
I ended up using HotKey Example: import SwiftUI import HotKey struct ContentView: View { let hotKey = HotKey(key: .tab , modifiers: [.option]) var body: some View { VStack {} .onAppear { hotKey.keyDownHandler = buttonHandler } } func buttonHandler() { /* ... */ } } But I'm still curious in how it can send the shortcuts without Accessibility permission.
2w
Reply to How to trigger Safari App Extension with a keyboard shortcut without a content script and Accessibility permissions?
So far I figured out: You can trigger a shortcut if you have a Safari Web Extension from background.js by adding a shortcut to manifest.json "commands": { "open-main-app": { "suggested_key": { "default": "Alt+K" }, "description": "Open Main App" } } But you can't set option+tab as a shortcut. Tab Back Lite's manifest.json but it does not have a shortcut in it. It only has nativeMessaging permission and a background script.
2w
Reply to Safari App Extension – conflicting Bundle Identifier
@jeffjohnson ah, sorry, my bad. So what's your best recommendation to this problem? Appending something to a bundle identifier? Not sure that this is the best solution because my bundle identifiers are present in multiple places and in multiple files: In Info.plist: CFBundleIdentifier In ... .xcodeproj/project.pbxpro: PRODUCT_BUNDLE_IDENTIFIER (Extension) In ... .xcodeproj/project.pbxpro: PRODUCT_BUNDLE_IDENTIFIER (Main app) I just set a user-defined variable and use it everywhere, but i don't think it's the best solution so far. Do you? You said in the article that you might unregister the app. Can this be a fix to my problem?
3w
Reply to Safari App Extension – conflicting Bundle Identifier
@jeffjohnson You said that this bug was "fixed in macOS 13 Ventura", but i'm currently on macOS Ventura now and experience this bug. The thing is that i have this bug even if there is only one app is located on the system. And when at some point the amount of apps with the same bundle id gets to 2 or bigger, macOS just makes the extension disappear instead of giving any preference to any of the apps. I attached a video in the comments showcasing the bug: https://youtu.be/abpf3q6ah98
3w