Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: inject.preload.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Left Patch Set: Address the nits Created June 22, 2017, 1:32 p.m.
Right Patch Set: Cosmetic changes Created July 28, 2017, 11:02 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « icons/abp-50.png ('k') | lib/csp.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld