Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); |
michael@0 | 2 | |
michael@0 | 3 | const Cc = Components.classes; |
michael@0 | 4 | const Ci = Components.interfaces; |
michael@0 | 5 | |
michael@0 | 6 | function run_test() { |
michael@0 | 7 | let manifest = do_get_file('testcompnoaslr.manifest'); |
michael@0 | 8 | Components.manager.autoRegister(manifest); |
michael@0 | 9 | var sysInfo = Cc["@mozilla.org/system-info;1"]. |
michael@0 | 10 | getService(Ci.nsIPropertyBag2); |
michael@0 | 11 | var ver = parseFloat(sysInfo.getProperty("version")); |
michael@0 | 12 | if (ver < 6.0) { |
michael@0 | 13 | // This is disabled on pre-Vista OSs. |
michael@0 | 14 | do_check_true("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID); |
michael@0 | 15 | } else { |
michael@0 | 16 | do_check_false("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID); |
michael@0 | 17 | } |
michael@0 | 18 | } |