LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 constraints = args[1]; | 371 constraints = args[1]; |
372 | 372 |
373 let peerconnection = new RealRTCPeerConnection(configuration, constraints); | 373 let peerconnection = new RealRTCPeerConnection(configuration, constraints); |
374 checkConfiguration(peerconnection, configuration); | 374 checkConfiguration(peerconnection, configuration); |
375 return peerconnection; | 375 return peerconnection; |
376 } | 376 } |
377 | 377 |
378 WrappedRTCPeerConnection.prototype = RealRTCPeerConnection.prototype; | 378 WrappedRTCPeerConnection.prototype = RealRTCPeerConnection.prototype; |
379 | 379 |
380 let boundWrappedRTCPeerConnection = WrappedRTCPeerConnection.bind(); | 380 let boundWrappedRTCPeerConnection = WrappedRTCPeerConnection.bind(); |
381 // NOTE: Edge does not support generateCertificate | |
382 copyProperties(RealRTCPeerConnection, boundWrappedRTCPeerConnection, | 381 copyProperties(RealRTCPeerConnection, boundWrappedRTCPeerConnection, |
383 ["generateCertificate", "name", "prototype"]); | 382 ["generateCertificate", "name", "prototype"]); |
384 RealRTCPeerConnection.prototype.constructor = boundWrappedRTCPeerConnection; | 383 RealRTCPeerConnection.prototype.constructor = boundWrappedRTCPeerConnection; |
385 | 384 |
386 if ("RTCPeerConnection" in window) | 385 if ("RTCPeerConnection" in window) |
387 window.RTCPeerConnection = boundWrappedRTCPeerConnection; | 386 window.RTCPeerConnection = boundWrappedRTCPeerConnection; |
388 if ("webkitRTCPeerConnection" in window) | 387 if ("webkitRTCPeerConnection" in window) |
389 window.webkitRTCPeerConnection = boundWrappedRTCPeerConnection; | 388 window.webkitRTCPeerConnection = boundWrappedRTCPeerConnection; |
390 } | 389 } |
391 | 390 |
392 if (document instanceof HTMLDocument) | 391 if (document instanceof HTMLDocument) |
393 { | 392 { |
394 let sandbox = window.frameElement && | 393 let sandbox = window.frameElement && |
395 window.frameElement.getAttribute("sandbox"); | 394 window.frameElement.getAttribute("sandbox"); |
396 | 395 |
397 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox)) | 396 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox)) |
398 { | 397 { |
399 let script = document.createElement("script"); | 398 let script = document.createElement("script"); |
400 script.type = "application/javascript"; | 399 script.type = "application/javascript"; |
401 script.async = false; | 400 script.async = false; |
402 script.textContent = "(" + injected + ")('" + randomEventName + "');"; | 401 script.textContent = "(" + injected + ")('" + randomEventName + "');"; |
403 document.documentElement.appendChild(script); | 402 document.documentElement.appendChild(script); |
404 document.documentElement.removeChild(script); | 403 document.documentElement.removeChild(script); |
405 } | 404 } |
406 } | 405 } |
LEFT | RIGHT |