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 /** | |
399 * Verifies RSA signature. The public key and signature should be base64-encod
ed. | 383 * Verifies RSA signature. The public key and signature should be base64-encod
ed. |
400 * @param {string} key | 384 * @param {string} key |
401 * @param {string} signature | 385 * @param {string} signature |
402 * @param {string} data | 386 * @param {string} data |
403 * @return {boolean} | 387 * @return {boolean} |
404 */ | 388 */ |
405 verifySignature: function(key, signature, data) | 389 verifySignature: function(key, signature, data) |
406 { | 390 { |
407 if (!Utils.crypto) | 391 if (!Utils.crypto) |
408 return false; | 392 return false; |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 Cu.reportError(e); | 804 Cu.reportError(e); |
821 // Expected, ctypes isn't supported in Gecko 1.9.2 | 805 // Expected, ctypes isn't supported in Gecko 1.9.2 |
822 return null; | 806 return null; |
823 } | 807 } |
824 }); | 808 }); |
825 | 809 |
826 if ("@mozilla.org/messenger/headerparser;1" in Cc) | 810 if ("@mozilla.org/messenger/headerparser;1" in Cc) |
827 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen
ger/headerparser;1", "nsIMsgHeaderParser"); | 811 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen
ger/headerparser;1", "nsIMsgHeaderParser"); |
828 else | 812 else |
829 Utils.headerParser = null; | 813 Utils.headerParser = null; |
OLD | NEW |