Added JoiseDoc

This commit is contained in:
Minjae Song
2018-12-24 22:49:08 +09:00
parent ef3690765d
commit 47da7d5b81
84 changed files with 2109 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
'use strict';
window.addEventListener('message', function (e) {
if (e.origin !== window.location.origin) {
return;
}
if (e.data.to !== 'content') {
return;
}
if (e.data.type === 'webrtc-reload') {
window.location.reload();
}
});
(function modifyWebRTC(apis) {
apis.forEach(function (api) {
if (!(api && api.prototype.createOffer)) {
return;
}
var createOffer = api.prototype.createOffer;
api.prototype.createOffer = function () {
window.postMessage({
type: 'webrtc-call',
to: 'background'
}, window.location.origin);
return createOffer.apply(this, [].slice.call(arguments));
};
});
})([window.RTCPeerConnection, window.webkitRTCPeerConnection, window.mozRTCPeerConnection, window.msRTCPeerConnection]);