The Safari extension framework explicitly does not support message passing between extensions. I'm looking for a workable hack to get around this, without letting the page know that extensions are running.
Suggestions (not tested):
One extension opens a hidden tab to about:blank#extension-channel with openTab(). The other searches for that tab by URL and finds it. They produce and consume elements on that page to communicate.
If extensions can read cookies across domains, one sets a cookie with a random ID at extension-homepage.com and the other reads it. They then create DOM events with the name
extension-message-[the random ID]
", so the page can't listen in.Petition the Safari developers to add onRequestExternal to their API ;)
Can you think of another approach? Have you gotten any of the above to work?