- const audioElement = document.createElement('audio');
- audioElement.setAttribute('class', 'junction-call-audio');
- audioElement.src = source;
- audioElement.autoplay = 'autoplay';
- audioElement.type = type;
- document.querySelector('body').appendChild(audioElement);
- }
- };
+ Peers.reset();
+ Media.stop();
+ internals.socket.close();
+ internals.port.disconnect();
+ }
+};
+
+internals.port = chrome.runtime.connect({ name:"content" });
+internals.port.onMessage.addListener(internals.onMessage);