OLD | NEW |
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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 * Retrieves and removes sidebar state after detaching/reattaching | 373 * Retrieves and removes sidebar state after detaching/reattaching |
374 */ | 374 */ |
375 getParams: function() | 375 getParams: function() |
376 { | 376 { |
377 let ret = sidebarParams; | 377 let ret = sidebarParams; |
378 sidebarParams = null; | 378 sidebarParams = null; |
379 return ret; | 379 return ret; |
380 }, | 380 }, |
381 | 381 |
382 /** | 382 /** |
| 383 * E10S compatibility shims will reroute property retrieval on some objects |
| 384 * in order to enable custom behavior. This cannot be disabled on case by case |
| 385 * basis (see https://bugzilla.mozilla.org/show_bug.cgi?id=1167802). So |
| 386 * instead we use a different execution context to retrieve properties when |
| 387 * E10S compatibility shims shouldn't kick in. This method simply returns |
| 388 * obj[prop] but without any custom behavior. |
| 389 */ |
| 390 getPropertyWithoutCompatShims: function(/**Object*/ obj, /**String*/ prop) |
| 391 { |
| 392 let sandbox = Cu.Sandbox(Utils.systemPrincipal); |
| 393 sandbox.obj = obj; |
| 394 sandbox.prop = prop; |
| 395 return Cu.evalInSandbox("obj[prop]", sandbox); |
| 396 }, |
| 397 |
| 398 /** |
383 * Verifies RSA signature. The public key and signature should be base64-encod
ed. | 399 * Verifies RSA signature. The public key and signature should be base64-encod
ed. |
384 * @param {string} key | 400 * @param {string} key |
385 * @param {string} signature | 401 * @param {string} signature |
386 * @param {string} data | 402 * @param {string} data |
387 * @return {boolean} | 403 * @return {boolean} |
388 */ | 404 */ |
389 verifySignature: function(key, signature, data) | 405 verifySignature: function(key, signature, data) |
390 { | 406 { |
391 if (!Utils.crypto) | 407 if (!Utils.crypto) |
392 return false; | 408 return false; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 Cu.reportError(e); | 782 Cu.reportError(e); |
767 // Expected, ctypes isn't supported in Gecko 1.9.2 | 783 // Expected, ctypes isn't supported in Gecko 1.9.2 |
768 return null; | 784 return null; |
769 } | 785 } |
770 }); | 786 }); |
771 | 787 |
772 if ("@mozilla.org/messenger/headerparser;1" in Cc) | 788 if ("@mozilla.org/messenger/headerparser;1" in Cc) |
773 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen
ger/headerparser;1", "nsIMsgHeaderParser"); | 789 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen
ger/headerparser;1", "nsIMsgHeaderParser"); |
774 else | 790 else |
775 Utils.headerParser = null; | 791 Utils.headerParser = null; |
OLD | NEW |