belaviyo / send-to-vlc

A Webextension to send streamble media sources to VLC (VideoLAN) media player
http://add0n.com/send-to-vlc.html
Mozilla Public License 2.0
132 stars 37 forks source link

Handling messages from other extensions #19

Closed pgasior closed 6 years ago

pgasior commented 6 years ago

Can you add support for listening for messages from other extensions? I created addon that added "Send to ..." as button to links on page for convenience. Only problem is that your extension doesn't handle messages from other extensions.

I temporarily added onMessageExternal listener to your extension and it works as expected

chrome.runtime.onMessageExternal.addListener((request, sender) => {
  if (request.method === 'send-to-vlc') {
    sendToVLC(request.urls);
  }
})

This would be very helpful, as I wouldn't need to copy-paste your extension into mine and modify native-client manifest.

belaviyo commented 6 years ago

We are going to support this on the next release;

chrome.runtime.sendMessage('extension id here', {
  method: 'play',
  passphrase: 'a shared passphrase',
  urls: ['url-1', 'url-2', ...]
})