354
354
user_pref("javascript.options.tracejit.content", true);
355
355
user_pref("javascript.options.methodjit.content", true);
356
356
user_pref("javascript.options.jitprofiling.content", true);
357
user_pref("javascript.options.methodjit_always", false);
357
358
user_pref("gfx.color_management.force_srgb", true);
358
359
user_pref("network.manage-offline-status", false);
359
360
user_pref("test.mousescroll", true);
439
441
var isHttp = matches[1] == 'http';
440
442
var isHttps = matches[1] == 'https';
441
443
var isWebSocket = matches[1] == 'ws';
444
var isWebSocketSSL = matches[1] == 'wss';
444
447
if (isHttp | isWebSocket) matches[3] = '80';
445
if (isHttps) matches[3] = '443';
448
if (isHttps | isWebSocketSSL) matches[3] = '443';
448
451
matches[1] = 'http';
453
matches[1] = 'https';
450
455
var origin = matches[1] + '://' + matches[2] + ':' + matches[3];
451
456
if (origins.indexOf(origin) < 0)
454
459
return 'PROXY %(remote)s:%(httpport)s';
455
if (isHttps || isWebSocket)
460
if (isHttps || isWebSocket || isWebSocketSSL)
456
461
return 'PROXY %(remote)s:%(sslport)s';
458
463
}""" % { "origins": origins,
920
Copies an "installed" extension into the extensions directory of the given profile
921
extensionSource - the source location of the extension files. This can be either
919
Copies an extension into the extensions directory of the given profile.
920
extensionSource - the source location of the extension files. This can be either
922
921
a directory or a path to an xpi file.
923
922
profileDir - the profile directory we are copying into. We will create the
924
"extensions" directory there if it doesn't exist
923
"extensions" directory there if it doesn't exist.
925
924
extensionID - the id of the extension to be used as the containing directory for the
925
extension, if extensionSource is a directory, i.e.
927
926
this is the name of the folder in the <profileDir>/extensions/<extensionID>
929
def installExtension(self, extensionSource, profileDir, extensionID):
930
if (not os.path.exists(extensionSource)):
931
self.log.info("INFO | automation.py | Cannot install extension no source at: %s", extensionSource)
934
if (not os.path.exists(profileDir)):
935
self.log.info("INFO | automation.py | Cannot install extension invalid profileDir at: %s", profileDir)
928
def installExtension(self, extensionSource, profileDir, extensionID = None):
929
if not os.path.isdir(profileDir):
930
self.log.info("INFO | automation.py | Cannot install extension, invalid profileDir at: %s", profileDir)
938
# See if we have an XPI or a directory
939
if (os.path.isfile(extensionSource)):
940
tmpd = tempfile.mkdtemp()
941
extrootdir = self.extractZip(extensionSource, tmpd)
943
extrootdir = extensionSource
944
933
extnsdir = os.path.join(profileDir, "extensions")
945
extnshome = os.path.join(extnsdir, extensionID)
947
# Now we copy the extension source into the extnshome
948
shutil.copytree(extrootdir, extnshome)
950
def extractZip(self, filename, dest):
951
z = zipfile.ZipFile(filename, 'r')
952
for n in z.namelist():
953
fullpath = os.path.join(dest, n)
954
parentdir = os.path.dirname(fullpath)
955
if not os.path.isdir(parentdir):
956
os.makedirs(parentdir)
957
if (not n.endswith(os.sep)):
959
f = open(fullpath, 'w')
935
if os.path.isfile(extensionSource):
936
# Copy extension xpi directly.
937
# "destination file is created or overwritten".
938
shutil.copy2(extensionSource, extnsdir)
939
elif os.path.isdir(extensionSource):
940
if extensionID == None:
941
self.log.info("INFO | automation.py | Cannot install extension, missing extensionID")
944
# Copy extension tree into its own directory.
945
# "destination directory must not already exist".
946
shutil.copytree(extensionSource, os.path.join(extnsdir, extensionID))
948
self.log.info("INFO | automation.py | Cannot install extension, invalid extensionSource at: %s", extensionSource)