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 | <!-- |
michael@0 | 2 | Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 4 | --> |
michael@0 | 5 | <!DOCTYPE HTML> |
michael@0 | 6 | <html> |
michael@0 | 7 | <head> |
michael@0 | 8 | <title>Test for SharedWorker</title> |
michael@0 | 9 | </head> |
michael@0 | 10 | <body> |
michael@0 | 11 | <script type="text/javascript;version=1.7"> |
michael@0 | 12 | "use strict"; |
michael@0 | 13 | |
michael@0 | 14 | function debug(message) { |
michael@0 | 15 | if (typeof(message) != "string") { |
michael@0 | 16 | throw new Error("debug() only accepts strings!"); |
michael@0 | 17 | } |
michael@0 | 18 | parent.postMessage(message, "*"); |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | let worker; |
michael@0 | 22 | |
michael@0 | 23 | window.addEventListener("message", function(event) { |
michael@0 | 24 | if (!worker) { |
michael@0 | 25 | worker = new SharedWorker("multi_sharedWorker_sharedWorker.js", |
michael@0 | 26 | "FrameWorker"); |
michael@0 | 27 | worker.onerror = function(event) { |
michael@0 | 28 | debug("Worker error: " + event.message); |
michael@0 | 29 | event.preventDefault(); |
michael@0 | 30 | |
michael@0 | 31 | let data = { |
michael@0 | 32 | type: "error", |
michael@0 | 33 | message: event.message, |
michael@0 | 34 | filename: event.filename, |
michael@0 | 35 | lineno: event.lineno, |
michael@0 | 36 | isErrorEvent: event instanceof ErrorEvent |
michael@0 | 37 | }; |
michael@0 | 38 | parent.postMessage(data, "*"); |
michael@0 | 39 | }; |
michael@0 | 40 | |
michael@0 | 41 | worker.port.onmessage = function(event) { |
michael@0 | 42 | debug("Worker message: " + JSON.stringify(event.data)); |
michael@0 | 43 | parent.postMessage(event.data, "*"); |
michael@0 | 44 | }; |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | debug("Posting message: " + JSON.stringify(event.data)); |
michael@0 | 48 | worker.port.postMessage(event.data); |
michael@0 | 49 | }); |
michael@0 | 50 | </script> |
michael@0 | 51 | </body> |
michael@0 | 52 | </html> |