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

Side by Side Diff: inject.preload.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Patch Set: Handle webRequest.ResourceType (#5321) and RTCPeerConnection.generateCertificate, address comments Created June 15, 2017, 11:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 constraints = args[1]; 368 constraints = args[1];
369 369
370 let peerconnection = new RealRTCPeerConnection(configuration, constraints); 370 let peerconnection = new RealRTCPeerConnection(configuration, constraints);
371 checkConfiguration(peerconnection, configuration); 371 checkConfiguration(peerconnection, configuration);
372 return peerconnection; 372 return peerconnection;
373 } 373 }
374 374
375 WrappedRTCPeerConnection.prototype = RealRTCPeerConnection.prototype; 375 WrappedRTCPeerConnection.prototype = RealRTCPeerConnection.prototype;
376 376
377 let boundWrappedRTCPeerConnection = WrappedRTCPeerConnection.bind(); 377 let boundWrappedRTCPeerConnection = WrappedRTCPeerConnection.bind();
378 copyProperties(RealRTCPeerConnection, boundWrappedRTCPeerConnection, 378 // NOTE: Edge does not support generateCertificate
Sebastian Noack 2017/06/19 11:07:02 But what is about the other properties copied here
kzar 2017/06/19 14:13:38 Yea, this is not good. Please instead modify the c
Oleksandr 2017/06/21 23:38:35 Done.
379 ["generateCertificate", "name", "prototype"]); 379 if ("generateCertificate" in RealRTCPeerConnection)
380 copyProperties(RealRTCPeerConnection, boundWrappedRTCPeerConnection,
381 ["generateCertificate", "name", "prototype"]);
380 RealRTCPeerConnection.prototype.constructor = boundWrappedRTCPeerConnection; 382 RealRTCPeerConnection.prototype.constructor = boundWrappedRTCPeerConnection;
381 383
382 if ("RTCPeerConnection" in window) 384 if ("RTCPeerConnection" in window)
383 window.RTCPeerConnection = boundWrappedRTCPeerConnection; 385 window.RTCPeerConnection = boundWrappedRTCPeerConnection;
384 if ("webkitRTCPeerConnection" in window) 386 if ("webkitRTCPeerConnection" in window)
385 window.webkitRTCPeerConnection = boundWrappedRTCPeerConnection; 387 window.webkitRTCPeerConnection = boundWrappedRTCPeerConnection;
386 } 388 }
387 389
388 if (document instanceof HTMLDocument) 390 if (document instanceof HTMLDocument)
389 { 391 {
390 let sandbox = window.frameElement && 392 let sandbox = window.frameElement &&
391 window.frameElement.getAttribute("sandbox"); 393 window.frameElement.getAttribute("sandbox");
392 394
393 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox)) 395 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox))
394 { 396 {
395 let script = document.createElement("script"); 397 let script = document.createElement("script");
396 script.type = "application/javascript"; 398 script.type = "application/javascript";
397 script.async = false; 399 script.async = false;
398 script.textContent = "(" + injected + ")('" + randomEventName + "');"; 400 script.textContent = "(" + injected + ")('" + randomEventName + "');";
399 document.documentElement.appendChild(script); 401 document.documentElement.appendChild(script);
400 document.documentElement.removeChild(script); 402 document.documentElement.removeChild(script);
401 } 403 }
402 } 404 }
OLDNEW

Powered by Google App Engine
This is Rietveld