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 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Script-inserted script</title> |
michael@0 | 5 | </head> |
michael@0 | 6 | <body> |
michael@0 | 7 | <div></div> |
michael@0 | 8 | <script> |
michael@0 | 9 | function log(text) { |
michael@0 | 10 | var p = document.createElement("p"); |
michael@0 | 11 | p.appendChild(document.createTextNode(text)); |
michael@0 | 12 | document.getElementsByTagName("div")[0].appendChild(p); |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | var head = document.getElementsByTagName("head")[0]; |
michael@0 | 16 | |
michael@0 | 17 | var external = document.createElement("script"); |
michael@0 | 18 | external.src = "bug591981-script.js"; |
michael@0 | 19 | head.insertBefore(external, head.firstChild); // what jQuery does |
michael@0 | 20 | |
michael@0 | 21 | var internal = document.createElement("script"); |
michael@0 | 22 | var data = "log('internal')"; |
michael@0 | 23 | try { |
michael@0 | 24 | internal.text = data; |
michael@0 | 25 | } catch(e) { |
michael@0 | 26 | internal.appendChild(document.createTextNode(data)); |
michael@0 | 27 | } |
michael@0 | 28 | head.insertBefore(internal, head.firstChild); // what jQuery does |
michael@0 | 29 | |
michael@0 | 30 | </script> |
michael@0 | 31 | </body> |
michael@0 | 32 | </html> |