Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | // This is a workaround for bug 465088, that the qcms assembly doesn't |
michael@0 | 2 | // quite match the non-assembly output. |
michael@0 | 3 | |
michael@0 | 4 | function check_qcms_has_assembly() |
michael@0 | 5 | { |
michael@0 | 6 | // We have assembly code on x86 and x86_64 architectures. |
michael@0 | 7 | // Unfortunately, detecting that is a little complicated. |
michael@0 | 8 | |
michael@0 | 9 | if (navigator.platform == "MacIntel") { |
michael@0 | 10 | return true; |
michael@0 | 11 | } |
michael@0 | 12 | |
michael@0 | 13 | if (navigator.platform.indexOf("Win") == 0 || navigator.platform == "OS/2") { |
michael@0 | 14 | // Assume all Windows and OS/2 is x86 or x86_64. We don't |
michael@0 | 15 | // expose any way for Web content to check. |
michael@0 | 16 | return true; |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | // On most Unix-like platforms, navigator.platform is basically |
michael@0 | 20 | // |uname -sm|. |
michael@0 | 21 | if (navigator.platform.match(/(i[3456]86|x86_64|amd64|i86)/)) { |
michael@0 | 22 | return true; |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | return false; |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | var qcms_has_assembly = check_qcms_has_assembly(); |