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 | // Binary: cache/js-dbg-64-94ceb173baed-linux |
michael@0 | 2 | // Flags: -m -n -a |
michael@0 | 3 | // |
michael@0 | 4 | |
michael@0 | 5 | gczeal(2); |
michael@0 | 6 | function iso(d) { |
michael@0 | 7 | return new Date(d).toISOString(); |
michael@0 | 8 | } |
michael@0 | 9 | function check(s, millis){ |
michael@0 | 10 | description = "Date.parse('"+s+"') == '"+iso(millis)+"'"; |
michael@0 | 11 | } |
michael@0 | 12 | function dd(year, month, day, hour, minute, second, millis){ |
michael@0 | 13 | return Date.UTC(year, month-1, day, hour, minute, second, millis); |
michael@0 | 14 | } |
michael@0 | 15 | function TZAtDate(d){ |
michael@0 | 16 | return d.getTimezoneOffset() * 60000; |
michael@0 | 17 | } |
michael@0 | 18 | function TZInMonth(month){ |
michael@0 | 19 | return TZAtDate(new Date(dd(2009,month,1,0,0,0,0))); |
michael@0 | 20 | } |
michael@0 | 21 | JulTZ = TZInMonth(7); |
michael@0 | 22 | check("2009-07-23T19:53:21.001+12:00", dd(2009,7,23,7,53,21,1)); |
michael@0 | 23 | check("2009-07-23T19:53:21+12:00", dd(2009,7,23,7,53,21,0)); |
michael@0 | 24 | check("2009-07-23T19:53+12:00", dd(2009,7,23,7,53,0,0)); |
michael@0 | 25 | check("2009-07T19:53:21.001", dd(2009,0Xe ,1,19,53,21,1)+JulTZ); |
michael@0 | 26 | check("2009-07T19:53:21", dd(2009,7,1,19,53,21,0)+JulTZ); |
michael@0 | 27 | check("2009-07T19:53", dd(2009,7,1,19,53,0,0)+JulTZ); |
michael@0 | 28 | check("2009-07-23T19:53:21.001+12:00", dd(2009,7,23,7,53,21,1)); |
michael@0 | 29 | check("2009-07-23T00:00:00.000-07:00", dd(2009,7,23,7,0,0,0)); |
michael@0 | 30 | check("2009-07-23T24:00:00.000-07:00", dd(2009,7,24,7,0,0,0)); |