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: Rebase the README.md, compress images, adress the comments Created June 14, 2017, 3:33 a.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:
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
(no file at all)
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 dispatchEvent(new RealCustomEvent(eventName, 167 dispatchEvent(new RealCustomEvent(eventName,
168 {detail: {url, requestType}})); 168 {detail: {url, requestType}}));
169 }; 169 };
170 } 170 }
171 171
172 // Only to be called before the page's code, not hardened. 172 // Only to be called before the page's code, not hardened.
173 function copyProperties(src, dest, properties) 173 function copyProperties(src, dest, properties)
174 { 174 {
175 for (let name of properties) 175 for (let name of properties)
176 { 176 {
177 Object.defineProperty(dest, name, 177 if (src.hasOwnProperty(name))
178 Object.getOwnPropertyDescriptor(src, name)); 178 {
179 Object.defineProperty(dest, name,
180 Object.getOwnPropertyDescriptor(src, name));
181 }
179 } 182 }
180 } 183 }
181 184
182 /* 185 /*
183 * WebSocket wrapper 186 * WebSocket wrapper
184 * 187 *
185 * Required before Chrome 58, since the webRequest API didn't allow us to 188 * Required before Chrome 58, since the webRequest API didn't allow us to
186 * intercept WebSockets. 189 * intercept WebSockets.
187 * See https://bugs.chromium.org/p/chromium/issues/detail?id=129353 190 * See https://bugs.chromium.org/p/chromium/issues/detail?id=129353
188 */ 191 */
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox)) 396 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox))
394 { 397 {
395 let script = document.createElement("script"); 398 let script = document.createElement("script");
396 script.type = "application/javascript"; 399 script.type = "application/javascript";
397 script.async = false; 400 script.async = false;
398 script.textContent = "(" + injected + ")('" + randomEventName + "');"; 401 script.textContent = "(" + injected + ")('" + randomEventName + "');";
399 document.documentElement.appendChild(script); 402 document.documentElement.appendChild(script);
400 document.documentElement.removeChild(script); 403 document.documentElement.removeChild(script);
401 } 404 }
402 } 405 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld