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

Side by Side Diff: inject.preload.js

Issue 29503619: Noissue - Throw TypeError when RTCPeerConnection called without new operator (Closed)
Patch Set: Created Aug. 2, 2017, 4:58 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // Call the real method first, so that validates the configuration for 352 // Call the real method first, so that validates the configuration for
353 // us. Also we might as well since checkRequest is asynchronous anyway. 353 // us. Also we might as well since checkRequest is asynchronous anyway.
354 realSetConfiguration(this, configuration); 354 realSetConfiguration(this, configuration);
355 checkConfiguration(this, configuration); 355 checkConfiguration(this, configuration);
356 }; 356 };
357 } 357 }
358 358
359 function WrappedRTCPeerConnection(...args) 359 function WrappedRTCPeerConnection(...args)
360 { 360 {
361 if (!(this instanceof WrappedRTCPeerConnection)) 361 if (!(this instanceof WrappedRTCPeerConnection))
362 return WrappedRTCPeerConnection(); 362 return RealRTCPeerConnection();
363 363
364 let configuration = protectConfiguration(args[0]); 364 let configuration = protectConfiguration(args[0]);
365 365
366 // Since the old webkitRTCPeerConnection constructor takes an optional 366 // Since the old webkitRTCPeerConnection constructor takes an optional
367 // second argument we need to take care to pass that through. Necessary 367 // second argument we need to take care to pass that through. Necessary
368 // for older versions of Chrome such as 49. 368 // for older versions of Chrome such as 49.
369 let constraints = undefined; 369 let constraints = undefined;
370 if (args.length > 1) 370 if (args.length > 1)
371 constraints = args[1]; 371 constraints = args[1];
372 372
(...skipping 23 matching lines...) Expand all
396 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox)) 396 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox))
397 { 397 {
398 let script = document.createElement("script"); 398 let script = document.createElement("script");
399 script.type = "application/javascript"; 399 script.type = "application/javascript";
400 script.async = false; 400 script.async = false;
401 script.textContent = "(" + injected + ")('" + randomEventName + "');"; 401 script.textContent = "(" + injected + ")('" + randomEventName + "');";
402 document.documentElement.appendChild(script); 402 document.documentElement.appendChild(script);
403 document.documentElement.removeChild(script); 403 document.documentElement.removeChild(script);
404 } 404 }
405 } 405 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld