-
Notifications
You must be signed in to change notification settings - Fork 13
Description
- Enable/disable plugin
- Implement macOS project target #20 Implement macOS project target
- show/hide viewer
- send selected text from Safari to the app cba6550
- Show Safari plugin status and click on status to switch on/off bc40db1 e281898
- Support shortcuts in Safari web pages d9b6f58 f6fe4b4
- disable/enable translating selected text in Safari by shortcut
sorCtrl/Alt+s - disable/enable speaking selected text in Safari by shortcut
aorCtrl/Alt+a
- disable/enable translating selected text in Safari by shortcut
- .lineLimit(nil) doesn't works for TextField #21 .lineLimit(nil) doesn't works for TextField
- Improve: Send shared messages every 1 second 43bc87b
- Improve: speak method 43bc87b
- Bug: Google Translate view goes over the top border #22 Google Translate view goes over the top border e281898
Important
- Info.plist
<dict>
<key>Allowed Domains</key>
<array>
<string>*</string>
</array>
<key>Level</key>
<string>All</string>
</dict>- Info.plist
<key>NSAppleEventsUsageDescription</key>
<string>ReaderTranslator communicates with other apps on your Mac when you choose to share a news item.</string>- Info.plist
<key>AppIdentifierPrefix</key>
<string>$(AppIdentifierPrefix)</string>- Add
App Group - See Important Implement macOS project target #20
Info
My question about CFNotificationCenterGetDarwinNotifyCenter on stackoverlow
Sharing data between iOS apps and app extensions
How to Build Safari App Extensions
More articles about it in #6
If the extension runs as a separate process then this is impossible: Memory allocated in one process is not available in a different process. – Martin R 9 hours ago
Sound strange I see CFNotificationCenterGetDarwinNotifyCenter manage it. – Victor Kushnerov 9 hours agoCompare developer.apple.com/documentation/corefoundation/…: if center is a Darwin notification center then object and userInfo are ignored. – Martin R 9 hours ago
How max length a message name? – Victor Kushnerov 9 hours agoI have no idea ... – Martin R 9 hours ago
I guess I have to use combine UserDefaults and CFNotificationCenterGetDarwinNotifyCenter to send some long text? – Victor Kushnerov 9 hours agoCompare stackoverflow.com/a/35206961/1187415. – Martin R 9 hours ago
Thanks for point out that object and userInfo are ignored. I missed it. Why use UnsafeRawPointer in same process? – Victor Kushnerov 8 hours agoHere is an example where the raw pointer is used to pass a pointer to a class instance to the callback function. – Martin R 8 hours ago
I see but I can't imagine a situation why it is necessary since class it is reference type? – Victor Kushnerov 8 hours ago
When I call some method with class type parameter I send a pointer. – Victor Kushnerov 8 hours agoCFNotificationCenterPostNotification is actually a C function, and the callback is also a pure C function. C knows nothing about Swift types or instance pointers. That's why the object parameter is a UnsafeRawPointer (the Swift equivalent of void *). – Martin R 8 hours ago
Awesome, I got it now, thanks. – Victor Kushnerov 8 hours ago
I add stackoverflow.com/a/58188965/4067700 to help guys to get the goal quickly. The question is closed by me thanks @MartinR. – Victor Kushnerov 7 hours ago