This repository has been archived by the owner on Sep 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't compile browserscripts with babel anymore
- Loading branch information
1 parent
6eee186
commit e0a0177
Showing
5 changed files
with
88 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"env": { | ||
"browser": true | ||
}, | ||
rules: { | ||
semi: ["error", "always", { "omitLastInOneLineBlock": true}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
export default function getStats (from, to, interval) { | ||
var recordedStats = Object.keys(window._webdriverrtc || {}) | ||
var snapshots = [] | ||
module.exports = function getStats (from, to, interval) { | ||
var recordedStats = Object.keys(window._webdriverrtc || {}); | ||
var snapshots = []; | ||
|
||
/** | ||
* if no appropiate parameter was given return the last stat | ||
*/ | ||
if (!from) { | ||
return window._webdriverrtc[recordedStats[recordedStats.length - 1]] | ||
return window._webdriverrtc[recordedStats[recordedStats.length - 1]]; | ||
} | ||
|
||
recordedStats.forEach(function (timestamp) { | ||
timestamp = parseInt(timestamp, 10) | ||
timestamp = parseInt(timestamp, 10); | ||
if (timestamp > (from - interval / 2) && (timestamp - interval / 2) < to) { | ||
snapshots.push(window._webdriverrtc[timestamp]) | ||
snapshots.push(window._webdriverrtc[timestamp]); | ||
} | ||
}) | ||
}); | ||
|
||
return snapshots | ||
return snapshots; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
export default function url () { | ||
var OriginalRTCPeerConnection | ||
module.exports = function url () { | ||
var OriginalRTCPeerConnection; | ||
|
||
/** | ||
* method to masquerade RTCPeerConnection | ||
*/ | ||
var masqueradeFunction = function (param1, param2, param3) { | ||
var pc = new OriginalRTCPeerConnection(param1, param2, param3) | ||
window.webdriverRTCPeerConnectionBucket = pc | ||
return pc | ||
} | ||
var pc = new OriginalRTCPeerConnection(param1, param2, param3); | ||
window.webdriverRTCPeerConnectionBucket = pc; | ||
return pc; | ||
}; | ||
|
||
if (window.RTCPeerConnection) { | ||
OriginalRTCPeerConnection = window.RTCPeerConnection | ||
window.RTCPeerConnection = masqueradeFunction | ||
OriginalRTCPeerConnection = window.RTCPeerConnection; | ||
window.RTCPeerConnection = masqueradeFunction; | ||
} else if (window.webkitRTCPeerConnection) { | ||
OriginalRTCPeerConnection = window.webkitRTCPeerConnection | ||
window.webkitRTCPeerConnection = masqueradeFunction | ||
OriginalRTCPeerConnection = window.webkitRTCPeerConnection; | ||
window.webkitRTCPeerConnection = masqueradeFunction; | ||
} else if (window.mozRTCPeerConnection) { | ||
OriginalRTCPeerConnection = window.mozRTCPeerConnection | ||
window.mozRTCPeerConnection = masqueradeFunction | ||
OriginalRTCPeerConnection = window.mozRTCPeerConnection; | ||
window.mozRTCPeerConnection = masqueradeFunction; | ||
} | ||
} | ||
}; |