mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-28 15:46:16 +00:00
chore: Sync upstream to Firefox 147.0.2, p=#12067
This commit is contained in:
@@ -35,7 +35,7 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
|
||||
### Firefox Versions
|
||||
|
||||
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `147.0.1`! 🚀
|
||||
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 147.0.1`!
|
||||
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 147.0.2`!
|
||||
|
||||
### Contributing
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
783b222b1b93fb9e8c52eb57558ef7f07bca6e7e
|
||||
0bb7af8f277a229203f46cbba04b9ac7890c52ba
|
||||
@@ -682,6 +682,13 @@ async function testFileAccessWindowsOnly() {
|
||||
let tests = [];
|
||||
|
||||
let extDir = GetPerUserExtensionDir();
|
||||
// We used to unconditionally create this directory from Firefox, but that
|
||||
// was dropped in bug 2001887. The value of this directory is questionable;
|
||||
// the test was added in Firefox 56 (bug 1403744) to cover legacy add-ons,
|
||||
// but legacy add-on support was discontinued in Firefox 57, and we stopped
|
||||
// sideloading add-ons from this directory on all builds except ESR in
|
||||
// Firefox 74 (bug 1602840).
|
||||
await IOUtils.makeDirectory(extDir.path);
|
||||
tests.push({
|
||||
desc: "per-user extensions dir",
|
||||
ok: true,
|
||||
|
||||
@@ -22,6 +22,13 @@ add_setup(async function setup() {
|
||||
const xdgConfigHome = Services.env.get("XDG_CONFIG_HOME");
|
||||
Assert.greater(xdgConfigHome.length, 1, "XDG_CONFIG_HOME is defined");
|
||||
|
||||
// Verify the profile directory is inside XDG_CONFIG_HOME
|
||||
const profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
|
||||
Assert.ok(
|
||||
profileDir.path.startsWith(xdgConfigHome),
|
||||
`Profile directory (${profileDir.path}) should be inside XDG_CONFIG_HOME (${xdgConfigHome})`
|
||||
);
|
||||
|
||||
// If it is there, do actual testing
|
||||
sanityChecks();
|
||||
});
|
||||
|
||||
@@ -12,11 +12,14 @@ support-files = [
|
||||
"browser_content_sandbox_utils.js",
|
||||
"browser_content_sandbox_fs_tests.js",
|
||||
]
|
||||
# .config needs to exists for the sandbox to properly add it
|
||||
test-directories = ["/tmp/.xdg_default_test", "/tmp/.xdg_default_test/.config"]
|
||||
test-directories = [
|
||||
"/tmp/.xdg_default_test",
|
||||
"/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile",
|
||||
]
|
||||
environment = [
|
||||
"HOME=/tmp/.xdg_default_test",
|
||||
]
|
||||
profile-path = "/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile"
|
||||
|
||||
["browser_content_sandbox_fs_xdg_default.js"]
|
||||
run-if = ["os == 'linux'"]
|
||||
|
||||
@@ -12,12 +12,17 @@ support-files = [
|
||||
"browser_content_sandbox_utils.js",
|
||||
"browser_content_sandbox_fs_tests.js",
|
||||
]
|
||||
test-directories = ["/tmp/.xdg_mozLegacyHome_test/.config", "/tmp/.xdg_config_home_test"]
|
||||
test-directories = [
|
||||
"/tmp/.xdg_mozLegacyHome_test/.config",
|
||||
"/tmp/.xdg_config_home_test",
|
||||
"/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile",
|
||||
]
|
||||
environment = [
|
||||
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
|
||||
"HOME=/tmp/.xdg_mozLegacyHome_test",
|
||||
"MOZ_LEGACY_HOME=1",
|
||||
]
|
||||
profile-path = "/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile"
|
||||
|
||||
["browser_content_sandbox_fs_xdg_mozLegacyHome.js"]
|
||||
run-if = ["os == 'linux'"]
|
||||
|
||||
@@ -11,11 +11,15 @@ support-files = [
|
||||
"browser_content_sandbox_utils.js",
|
||||
"browser_content_sandbox_fs_tests.js",
|
||||
]
|
||||
test-directories = "/tmp/.xdg_config_home_test"
|
||||
test-directories = [
|
||||
"/tmp/.xdg_config_home_test",
|
||||
"/tmp/.xdg_config_home_test/mozilla/firefox/xdg_config_home_profile",
|
||||
]
|
||||
environment = [
|
||||
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
|
||||
"MOZ_LEGACY_HOME=0",
|
||||
]
|
||||
profile-path = "/tmp/.xdg_config_home_test/mozilla/firefox/xdg_config_home_profile"
|
||||
|
||||
["browser_content_sandbox_fs_xdg_xdgConfigHome.js"]
|
||||
run-if = [
|
||||
|
||||
@@ -17,69 +17,69 @@ import CoreText
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="print verbose registration failures",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"file", nargs="*", help="font file to register or unregister", default=[]
|
||||
)
|
||||
parser.add_argument(
|
||||
"-u",
|
||||
"--unregister",
|
||||
action="store_true",
|
||||
help="unregister the provided fonts",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
"--persist-user",
|
||||
action="store_true",
|
||||
help="permanently register the font",
|
||||
default=False,
|
||||
)
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="print verbose registration failures",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"file", nargs="*", help="font file to register or unregister", default=[]
|
||||
)
|
||||
parser.add_argument(
|
||||
"-u",
|
||||
"--unregister",
|
||||
action="store_true",
|
||||
help="unregister the provided fonts",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
"--persist-user",
|
||||
action="store_true",
|
||||
help="permanently register the font",
|
||||
default=False,
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.persist_user:
|
||||
scope = CoreText.kCTFontManagerScopeUser
|
||||
scopeDesc = "user"
|
||||
else:
|
||||
scope = CoreText.kCTFontManagerScopeSession
|
||||
scopeDesc = "session"
|
||||
|
||||
failureCount = 0
|
||||
for fontPath in args.file:
|
||||
fontURL = Cocoa.NSURL.fileURLWithPath_(fontPath)
|
||||
(result, error) = register_or_unregister_font(fontURL, args.unregister, scope)
|
||||
if result:
|
||||
print(
|
||||
"%sregistered font %s with %s scope"
|
||||
% (("un" if args.unregister else ""), fontPath, scopeDesc)
|
||||
)
|
||||
if args.persist_user:
|
||||
scope = CoreText.kCTFontManagerScopeUser
|
||||
scopeDesc = "user"
|
||||
else:
|
||||
print(
|
||||
"Failed to %sregister font %s with %s scope"
|
||||
% (("un" if args.unregister else ""), fontPath, scopeDesc)
|
||||
)
|
||||
if args.verbose:
|
||||
print(error)
|
||||
failureCount += 1
|
||||
scope = CoreText.kCTFontManagerScopeSession
|
||||
scopeDesc = "session"
|
||||
|
||||
sys.exit(failureCount)
|
||||
failureCount = 0
|
||||
for fontPath in args.file:
|
||||
fontURL = Cocoa.NSURL.fileURLWithPath_(fontPath)
|
||||
(result, error) = register_or_unregister_font(fontURL, args.unregister, scope)
|
||||
if result:
|
||||
print(
|
||||
"%sregistered font %s with %s scope"
|
||||
% (("un" if args.unregister else ""), fontPath, scopeDesc)
|
||||
)
|
||||
else:
|
||||
print(
|
||||
"Failed to %sregister font %s with %s scope"
|
||||
% (("un" if args.unregister else ""), fontPath, scopeDesc)
|
||||
)
|
||||
if args.verbose:
|
||||
print(error)
|
||||
failureCount += 1
|
||||
|
||||
sys.exit(failureCount)
|
||||
|
||||
|
||||
def register_or_unregister_font(fontURL, unregister, scope):
|
||||
return (
|
||||
CoreText.CTFontManagerUnregisterFontsForURL(fontURL, scope, None)
|
||||
if unregister
|
||||
else CoreText.CTFontManagerRegisterFontsForURL(fontURL, scope, None)
|
||||
)
|
||||
return (
|
||||
CoreText.CTFontManagerUnregisterFontsForURL(fontURL, scope, None)
|
||||
if unregister
|
||||
else CoreText.CTFontManagerRegisterFontsForURL(fontURL, scope, None)
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
@@ -31,138 +31,138 @@ from Cocoa import NSURL
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Utility to print, set, or "
|
||||
+ "check the path to image being used as "
|
||||
+ "the desktop background image. By "
|
||||
+ "default, prints the path to the "
|
||||
+ "current desktop background image."
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="print verbose debugging information",
|
||||
default=False,
|
||||
)
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
group.add_argument(
|
||||
"-s",
|
||||
"--set-background-image",
|
||||
dest="newBackgroundImagePath",
|
||||
required=False,
|
||||
help="path to the new background image to set. A zero "
|
||||
+ "exit code indicates no errors occurred.",
|
||||
default=None,
|
||||
)
|
||||
group.add_argument(
|
||||
"-c",
|
||||
"--check-background-image",
|
||||
dest="checkBackgroundImagePath",
|
||||
required=False,
|
||||
help="check if the provided background image path "
|
||||
+ "matches the provided path. A zero exit code "
|
||||
+ "indicates the paths match.",
|
||||
default=None,
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Using logging for verbose output
|
||||
if args.verbose:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
else:
|
||||
logging.basicConfig(level=logging.CRITICAL)
|
||||
logger = logging.getLogger("desktopImage")
|
||||
|
||||
# Print what we're going to do
|
||||
if args.checkBackgroundImagePath is not None:
|
||||
logger.debug(
|
||||
"checking provided desktop image %s matches current "
|
||||
"image" % args.checkBackgroundImagePath
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Utility to print, set, or "
|
||||
+ "check the path to image being used as "
|
||||
+ "the desktop background image. By "
|
||||
+ "default, prints the path to the "
|
||||
+ "current desktop background image."
|
||||
)
|
||||
elif args.newBackgroundImagePath is not None:
|
||||
logger.debug("setting image to %s " % args.newBackgroundImagePath)
|
||||
else:
|
||||
logger.debug("retrieving desktop image path")
|
||||
|
||||
focussedScreen = NSScreen.mainScreen()
|
||||
if not focussedScreen:
|
||||
raise RuntimeError("mainScreen error")
|
||||
|
||||
ws = NSWorkspace.sharedWorkspace()
|
||||
if not ws:
|
||||
raise RuntimeError("sharedWorkspace error")
|
||||
|
||||
# If we're just checking the image path, check it and then return.
|
||||
# A successful exit code (0) indicates the paths match.
|
||||
if args.checkBackgroundImagePath is not None:
|
||||
# Get existing desktop image path and resolve it
|
||||
existingImageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
existingImagePath = existingImageURL.path()
|
||||
existingImagePathReal = os.path.realpath(existingImagePath)
|
||||
logger.debug("existing desktop image: %s" % existingImagePath)
|
||||
logger.debug("existing desktop image realpath: %s" % existingImagePath)
|
||||
|
||||
# Resolve the path we're going to check
|
||||
checkImagePathReal = os.path.realpath(args.checkBackgroundImagePath)
|
||||
logger.debug("check desktop image: %s" % args.checkBackgroundImagePath)
|
||||
logger.debug("check desktop image realpath: %s" % checkImagePathReal)
|
||||
|
||||
if existingImagePathReal == checkImagePathReal:
|
||||
print("desktop image path matches provided path")
|
||||
return True
|
||||
|
||||
print("desktop image path does NOT match provided path")
|
||||
return False
|
||||
|
||||
# Log the current desktop image
|
||||
if args.verbose:
|
||||
existingImageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
logger.debug("existing desktop image: %s" % existingImageURL.path())
|
||||
|
||||
# Set the desktop image
|
||||
if args.newBackgroundImagePath is not None:
|
||||
newImagePath = args.newBackgroundImagePath
|
||||
if not os.path.exists(newImagePath):
|
||||
logger.critical("%s does not exist" % newImagePath)
|
||||
return False
|
||||
if not os.access(newImagePath, os.R_OK):
|
||||
logger.critical("%s is not readable" % newImagePath)
|
||||
return False
|
||||
|
||||
logger.debug("new desktop image to set: %s" % newImagePath)
|
||||
newImageURL = NSURL.fileURLWithPath_(newImagePath)
|
||||
logger.debug("new desktop image URL to set: %s" % newImageURL)
|
||||
|
||||
status = False
|
||||
(status, error) = ws.setDesktopImageURL_forScreen_options_error_(
|
||||
newImageURL, focussedScreen, None, None
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="print verbose debugging information",
|
||||
default=False,
|
||||
)
|
||||
if not status:
|
||||
raise RuntimeError("setDesktopImageURL error")
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
group.add_argument(
|
||||
"-s",
|
||||
"--set-background-image",
|
||||
dest="newBackgroundImagePath",
|
||||
required=False,
|
||||
help="path to the new background image to set. A zero "
|
||||
+ "exit code indicates no errors occurred.",
|
||||
default=None,
|
||||
)
|
||||
group.add_argument(
|
||||
"-c",
|
||||
"--check-background-image",
|
||||
dest="checkBackgroundImagePath",
|
||||
required=False,
|
||||
help="check if the provided background image path "
|
||||
+ "matches the provided path. A zero exit code "
|
||||
+ "indicates the paths match.",
|
||||
default=None,
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Print the current desktop image
|
||||
imageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
imagePath = imageURL.path()
|
||||
imagePathReal = os.path.realpath(imagePath)
|
||||
logger.debug("updated desktop image URL: %s" % imageURL)
|
||||
logger.debug("updated desktop image path: %s" % imagePath)
|
||||
logger.debug("updated desktop image path (resolved): %s" % imagePathReal)
|
||||
print(imagePathReal)
|
||||
return True
|
||||
# Using logging for verbose output
|
||||
if args.verbose:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
else:
|
||||
logging.basicConfig(level=logging.CRITICAL)
|
||||
logger = logging.getLogger("desktopImage")
|
||||
|
||||
# Print what we're going to do
|
||||
if args.checkBackgroundImagePath is not None:
|
||||
logger.debug(
|
||||
"checking provided desktop image %s matches current "
|
||||
"image" % args.checkBackgroundImagePath
|
||||
)
|
||||
elif args.newBackgroundImagePath is not None:
|
||||
logger.debug("setting image to %s " % args.newBackgroundImagePath)
|
||||
else:
|
||||
logger.debug("retrieving desktop image path")
|
||||
|
||||
focussedScreen = NSScreen.mainScreen()
|
||||
if not focussedScreen:
|
||||
raise RuntimeError("mainScreen error")
|
||||
|
||||
ws = NSWorkspace.sharedWorkspace()
|
||||
if not ws:
|
||||
raise RuntimeError("sharedWorkspace error")
|
||||
|
||||
# If we're just checking the image path, check it and then return.
|
||||
# A successful exit code (0) indicates the paths match.
|
||||
if args.checkBackgroundImagePath is not None:
|
||||
# Get existing desktop image path and resolve it
|
||||
existingImageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
existingImagePath = existingImageURL.path()
|
||||
existingImagePathReal = os.path.realpath(existingImagePath)
|
||||
logger.debug("existing desktop image: %s" % existingImagePath)
|
||||
logger.debug("existing desktop image realpath: %s" % existingImagePath)
|
||||
|
||||
# Resolve the path we're going to check
|
||||
checkImagePathReal = os.path.realpath(args.checkBackgroundImagePath)
|
||||
logger.debug("check desktop image: %s" % args.checkBackgroundImagePath)
|
||||
logger.debug("check desktop image realpath: %s" % checkImagePathReal)
|
||||
|
||||
if existingImagePathReal == checkImagePathReal:
|
||||
print("desktop image path matches provided path")
|
||||
return True
|
||||
|
||||
print("desktop image path does NOT match provided path")
|
||||
return False
|
||||
|
||||
# Log the current desktop image
|
||||
if args.verbose:
|
||||
existingImageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
logger.debug("existing desktop image: %s" % existingImageURL.path())
|
||||
|
||||
# Set the desktop image
|
||||
if args.newBackgroundImagePath is not None:
|
||||
newImagePath = args.newBackgroundImagePath
|
||||
if not os.path.exists(newImagePath):
|
||||
logger.critical("%s does not exist" % newImagePath)
|
||||
return False
|
||||
if not os.access(newImagePath, os.R_OK):
|
||||
logger.critical("%s is not readable" % newImagePath)
|
||||
return False
|
||||
|
||||
logger.debug("new desktop image to set: %s" % newImagePath)
|
||||
newImageURL = NSURL.fileURLWithPath_(newImagePath)
|
||||
logger.debug("new desktop image URL to set: %s" % newImageURL)
|
||||
|
||||
status = False
|
||||
(status, error) = ws.setDesktopImageURL_forScreen_options_error_(
|
||||
newImageURL, focussedScreen, None, None
|
||||
)
|
||||
if not status:
|
||||
raise RuntimeError("setDesktopImageURL error")
|
||||
|
||||
# Print the current desktop image
|
||||
imageURL = getCurrentDesktopImageURL(focussedScreen, ws, logger)
|
||||
imagePath = imageURL.path()
|
||||
imagePathReal = os.path.realpath(imagePath)
|
||||
logger.debug("updated desktop image URL: %s" % imageURL)
|
||||
logger.debug("updated desktop image path: %s" % imagePath)
|
||||
logger.debug("updated desktop image path (resolved): %s" % imagePathReal)
|
||||
print(imagePathReal)
|
||||
return True
|
||||
|
||||
|
||||
def getCurrentDesktopImageURL(focussedScreen, workspace, logger):
|
||||
imageURL = workspace.desktopImageURLForScreen_(focussedScreen)
|
||||
if not imageURL:
|
||||
raise RuntimeError("desktopImageURLForScreen returned invalid URL")
|
||||
if not imageURL.isFileURL():
|
||||
logger.warning("desktop image URL is not a file URL")
|
||||
return imageURL
|
||||
imageURL = workspace.desktopImageURLForScreen_(focussedScreen)
|
||||
if not imageURL:
|
||||
raise RuntimeError("desktopImageURLForScreen returned invalid URL")
|
||||
if not imageURL.isFileURL():
|
||||
logger.warning("desktop image URL is not a file URL")
|
||||
return imageURL
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not main():
|
||||
sys.exit(1)
|
||||
else:
|
||||
sys.exit(0)
|
||||
if not main():
|
||||
sys.exit(1)
|
||||
else:
|
||||
sys.exit(0)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"version": {
|
||||
"product": "firefox",
|
||||
"version": "147.0.1",
|
||||
"candidate": "147.0.1",
|
||||
"candidate": "147.0.2",
|
||||
"candidateBuild": 1
|
||||
},
|
||||
"buildOptions": {
|
||||
@@ -54,4 +54,4 @@
|
||||
"licenseType": "MPL-2.0"
|
||||
},
|
||||
"updateHostname": "updates.zen-browser.app"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user