]>
git.r.bdr.sh - rbdr/junction/blob - extension/junction.js
7de7c28012e5f8781f5fca622402745c48a7f17a
7 16: 'icons/action-16.png',
8 32: 'icons/action-32.png'
12 16: 'icons/hang_up-16.png',
13 32: 'icons/hang_up-32.png'
18 if (internals
.isInCall()) {
19 return internals
.hangUp();
22 return internals
.joinAudioCall();
25 async
joinAudioCall() {
27 internals
.isInCallState
= true;
28 internals
.setIcon('hangUp');
29 const tabs
= await browser
.tabs
.query({
34 internals
.createAudioElement(browser
.runtime
.getURL('sounds/tada.wav'));
39 document
.querySelectorAll('audio').forEach((audioElement
) => audioElement
.remove());
40 internals
.setIcon('call');
41 internals
.isInCallState
= false;
44 createAudioElement(source
) {
46 const audioElement
= document
.createElement('audio');
47 audioElement
.src
= source
;
48 audioElement
.autoplay
= 'autoplay';
49 document
.querySelector('body').appendChild(audioElement
);
53 return internals
.isInCallState
; // this should be replaced with actually checking the built stuff
58 browser
.browserAction
.setIcon({
59 path: internals
.icons
[iconSet
]
64 browser
.browserAction
.onClicked
.addListener(internals
.onClick
);