diff --git a/core/files.js b/core/files.js index 4d3e4d12..0aed5652 100644 --- a/core/files.js +++ b/core/files.js @@ -155,6 +155,9 @@ var files = { // Web Font Loader 'resources/webfont/1.6.28/webfont.jsm': true, + // WebRTC adapter + 'resources/webrtc-adapter/6.4.8/adapter.min.jsm': true, + // WOW 'resources/wow/1.1.2/wow.min.jsm': true }, diff --git a/core/mappings.js b/core/mappings.js index 8707e76e..29abba3e 100644 --- a/core/mappings.js +++ b/core/mappings.js @@ -105,6 +105,7 @@ var mappings = { 'vue/{version}/vue.min.js': resources.vueJs, 'webfont/{version}/webfont.js': resources.webfont, 'webfont/{version}/webfontloader.js': resources.webfont, + 'webrtc-adapter/{version}/adapter.min.js': resources.webRTCadapter, 'wow/{version}/wow.min.': resources.wow } }, diff --git a/core/resources.js b/core/resources.js index 0f781e34..0748b57a 100644 --- a/core/resources.js +++ b/core/resources.js @@ -237,6 +237,11 @@ var resources = { 'path': 'resources/webfont/{version}/webfontloader.jsm', 'type': 'application/javascript' }, + // WebRTC adapter + 'webRTCadapter': { + 'path': 'resources/webrtc-adapter/{version}/adapter.min.jsm', + 'type': 'application/javascript' + }, // WOW 'wow': { 'path': 'resources/wow/{version}/wow.min.jsm', diff --git a/modules/internal/helpers.js b/modules/internal/helpers.js index 0d6e7294..9da8ab20 100644 --- a/modules/internal/helpers.js +++ b/modules/internal/helpers.js @@ -274,6 +274,8 @@ helpers.determineResourceName = function (filename) { return 'Underscore.js'; case 'webfont.jsm': return 'Web Font Loader'; + case 'adapter.min.jsm': + return 'WebRTC adapter'; case 'vue.jsm': return 'Vue.js'; case 'wow.min.jsm': @@ -414,6 +416,8 @@ helpers.setLastVersion = function (type, version) { version = '1.0.28'; } else if (type.includes('webfont')) { version = '1.6.28'; + } else if (type.includes('/webrtc-adapter/6.')) { + version = '6.4.8'; } else if (type.includes('/wow/1.')) { version = '1.1.2'; } diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 943988b3..739db271 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -36,6 +36,7 @@
  • Added P2P Media Loader Core v0.6.2
  • Added JavaScript Cookie v2.2.1
  • Added clipboard.js v2.0.6
  • +
  • Added WebRTC adapter v6.4.8
  • Please update your uBlock/uMatrix rules diff --git a/resources/webrtc-adapter/6.4.8/adapter.min.jsm b/resources/webrtc-adapter/6.4.8/adapter.min.jsm new file mode 100644 index 00000000..2af0d152 --- /dev/null +++ b/resources/webrtc-adapter/6.4.8/adapter.min.jsm @@ -0,0 +1 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).adapter=e()}}(function(){return function a(o,s,c){function d(t,e){if(!s[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(p)return p(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=s[t]={exports:{}};o[t][0].call(i.exports,function(e){return d(o[t][1][e]||e)},i,i.exports,a,o,s,c)}return s[t].exports}for(var p="function"==typeof require&&require,e=0;en&&(n=e.maxptime)}),0n.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+n.sctp.maxMessageSize+" bytes)");return i.apply(r,arguments)}}}}},{"./utils":14,sdp:2}],8:[function(e,t,r){"use strict";var i=e("../utils"),a=e("./filtericeservers"),o=e("rtcpeerconnection-shim");t.exports={shimGetUserMedia:e("./getusermedia"),shimPeerConnection:function(e){var t=i.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var r=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){r.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var n=o(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=a(e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype},shimReplaceTrack:function(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)},shimGetDisplayMedia:function(t,e){if("getDisplayMedia"in t.navigator&&t.navigator.mediaDevices&&!("getDisplayMedia"in t.navigator.mediaDevices)){var r=t.navigator.getDisplayMedia;t.navigator.mediaDevices.getDisplayMedia=function(e){return r.call(t.navigator,e)},t.navigator.getDisplayMedia=function(e){return i.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),r.call(t.navigator,e)}}}}},{"../utils":14,"./filtericeservers":9,"./getusermedia":10,"rtcpeerconnection-shim":1}],9:[function(e,t,r){"use strict";var a=e("../utils");t.exports=function(e,n){var i=!1;return(e=JSON.parse(JSON.stringify(e))).filter(function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&a.deprecated("RTCIceServer.url","RTCIceServer.urls");var r="string"==typeof t;return r&&(t=[t]),t=t.filter(function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!i?i=!0:0===e.indexOf("stun:")&&14393<=n&&-1===e.indexOf("?transport=udp")}),delete e.url,e.urls=r?t[0]:t,!!t.length}})}},{"../utils":14}],10:[function(e,t,r){"use strict";t.exports=function(e){var t=e&&e.navigator,r=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return r(e).catch(function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))})}}},{}],11:[function(e,t,r){"use strict";var a=e("../utils");t.exports={shimGetUserMedia:e("./getusermedia"),shimOnTrack:function(e){"object"!=typeof e||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(r){r.stream.getTracks().forEach(function(e){var t=new Event("track");t.track=e,t.receiver={track:e},t.transceiver={receiver:t.receiver},t.streams=[r.stream],this.dispatchEvent(t)}.bind(this))}.bind(this))},enumerable:!0,configurable:!0}),"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimSourceObject:function(e){"object"==typeof e&&(!e.HTMLMediaElement||"srcObject"in e.HTMLMediaElement.prototype||Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(s){var c=a.detectBrowser(s);if("object"==typeof s&&(s.RTCPeerConnection||s.mozRTCPeerConnection)){s.RTCPeerConnection||(s.RTCPeerConnection=function(e,t){if(c.version<38&&e&&e.iceServers){for(var r=[],n=0;n=r&&parseInt(n[r],10)}t.exports={extractVersion:a,wrapPeerConnectionEvent:function(e,n,i){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,a=t.addEventListener;t.addEventListener=function(e,r){if(e!==n)return a.apply(this,arguments);function t(e){var t=i(e);t&&r(t)}return this._eventMap=this._eventMap||{},this._eventMap[r]=t,a.apply(this,[e,t])};var o=t.removeEventListener;t.removeEventListener=function(e,t){if(e!==n||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);var r=this._eventMap[t];return delete this._eventMap[t],o.apply(this,[e,r])},Object.defineProperty(t,"on"+n,{get:function(){return this["_on"+n]},set:function(e){this["_on"+n]&&(this.removeEventListener(n,this["_on"+n]),delete this["_on"+n]),e&&this.addEventListener(n,this["_on"+n]=e)},enumerable:!0,configurable:!0})}},disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(n=e)?"adapter.js logging disabled":"adapter.js logging enabled"},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(i=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"==typeof window){if(n)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){i&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,r={browser:null,version:null};if(void 0===e||!e.navigator)return r.browser="Not a browser.",r;if(t.mozGetUserMedia)r.browser="firefox",r.version=a(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)r.browser="chrome",r.version=a(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))r.browser="edge",r.version=a(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return r.browser="Not a supported browser.",r;r.browser="safari",r.version=a(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return r}}},{}]},{},[3])(3)});