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.
1 #! /usr/bin/env python
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 import os
8 import sys
10 # set the cuddlefish "root directory" for this process if it's not already
11 # set in the environment
12 cuddlefish_root = os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))
14 if 'CUDDLEFISH_ROOT' not in os.environ:
15 os.environ['CUDDLEFISH_ROOT'] = cuddlefish_root
17 # add our own python-lib path to the python module search path.
18 python_lib_dir = os.path.join(cuddlefish_root, "python-lib")
19 if python_lib_dir not in sys.path:
20 sys.path.insert(0, python_lib_dir)
22 # now export to env so sub-processes get it too
23 if 'PYTHONPATH' not in os.environ:
24 os.environ['PYTHONPATH'] = python_lib_dir
25 elif python_lib_dir not in os.environ['PYTHONPATH'].split(os.pathsep):
26 paths = os.environ['PYTHONPATH'].split(os.pathsep)
27 paths.insert(0, python_lib_dir)
28 os.environ['PYTHONPATH'] = os.pathsep.join(paths)
30 import cuddlefish
32 if __name__ == '__main__':
33 cuddlefish.run()