Last active
June 10, 2020 08:22
-
-
Save y-i/b71f196bbbf4267c54ff1e4147033457 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Offer Answer Sniffer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1.0 | |
// @description Sniff sLD/sRD | |
// @author You | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
const orgSLD = RTCPeerConnection.prototype.setLocalDescription; | |
const orgSRD = RTCPeerConnection.prototype.setRemoteDescription; | |
RTCPeerConnection.prototype.setLocalDescription = function (sdp) { | |
console.log('sLD:', sdp.sdp); | |
return orgSLD.apply(this, [sdp]); | |
}; | |
RTCPeerConnection.prototype.setRemoteDescription = function (sdp) { | |
console.log('sRD:', sdp.sdp); | |
return orgSRD.apply(this, [sdp]); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment