I'm building a macOS safari extension and porting its functionality from a chrome extension.
The chrome extension uses native messaging hosts to communicate with another process using IPC and holding a persistent connection. To use the same functionality in Safari, I understand that will need to use the handler to communicate it to the containing app, and the app will have to hold the persistent IPC connection. My question derives from that concept: should the app be running in a long-lived state? And if so, how can I ensure that app be running 100% of the time.
Also is there any way I can control it's lifecycle with the Safari browser's lifecycle?
I will not be using XPC here, but a different UDS to make the connection.
Also in addition to that, what would you recommend the best approach is the communicate between the extension and it's handler? -> should it be again a UDS or userDefaults +darwin notification be enough?
Also I wouldn't want the inter-message relayed between components to be dropped, is there a fault tolerant architecture you would recommend?
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags:
Inter-process communication
Safari Extensions
Background Tasks
0
0
42