Index: inject.preload.js |
=================================================================== |
--- a/inject.preload.js |
+++ b/inject.preload.js |
@@ -133,18 +133,17 @@ |
let thisShadow = shadowRoot(this); |
return thisShadow == ourShadowRoot ? null : thisShadow; |
} |
}); |
} |
} |
/* |
- * Shared request checking code, used by both the WebSocket and |
- * RTCPeerConnection wrappers. |
+ * Shared request checking code, used by the RTCPeerConnection wrapper. |
Sebastian Noack
2018/03/13 17:43:01
Well, it's no longer shared. We probably should ju
Manish Jethani
2018/03/13 18:05:11
Done.
|
*/ |
let RealCustomEvent = window.CustomEvent; |
// If we've been injected into a frame via contentWindow then we can simply |
// grab the copy of checkRequest left for us by the parent document. Otherwise |
// we need to set it up now, along with the event handling functions. |
if (injectedIntoContentWindow) |
checkRequest = window[eventName]; |
@@ -178,50 +177,16 @@ |
{ |
Object.defineProperty(dest, name, |
Object.getOwnPropertyDescriptor(src, name)); |
} |
} |
} |
/* |
- * WebSocket wrapper |
- * |
- * Required before Chrome 58, since the webRequest API didn't allow us to |
- * intercept WebSockets. |
- * See https://bugs.chromium.org/p/chromium/issues/detail?id=129353 |
- */ |
- let RealWebSocket = WebSocket; |
- let closeWebSocket = Function.prototype.call.bind( |
- RealWebSocket.prototype.close |
- ); |
- |
- function WrappedWebSocket(url, ...args) |
- { |
- // Throw correct exceptions if the constructor is used improperly. |
- if (!(this instanceof WrappedWebSocket)) return RealWebSocket(); |
- if (arguments.length < 1) return new RealWebSocket(); |
- |
- let websocket = new RealWebSocket(url, ...args); |
- |
- checkRequest("websocket", websocket.url, blocked => |
- { |
- if (blocked) |
- closeWebSocket(websocket); |
- }); |
- |
- return websocket; |
- } |
- WrappedWebSocket.prototype = RealWebSocket.prototype; |
- window.WebSocket = WrappedWebSocket.bind(); |
- copyProperties(RealWebSocket, WebSocket, |
- ["CONNECTING", "OPEN", "CLOSING", "CLOSED", "prototype"]); |
- RealWebSocket.prototype.constructor = WebSocket; |
- |
- /* |
* RTCPeerConnection wrapper |
* |
* The webRequest API in Chrome does not yet allow the blocking of |
* WebRTC connections. |
* See https://bugs.chromium.org/p/chromium/issues/detail?id=707683 |
*/ |
let RealRTCPeerConnection = window.RTCPeerConnection || |
window.webkitRTCPeerConnection; |