Update On Fri Apr 7 20:55:13 CEST 2023

This commit is contained in:
github-action[bot] 2023-04-07 20:55:14 +02:00
parent 9503ac2f52
commit 87c6c18b73
157 changed files with 4103 additions and 2279 deletions

122
Cargo.lock generated
View file

@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8512c9117059663fb5606788fbca3619e2a91dac0e3fe516242eab1fa6be5e44"
dependencies = [
"alsa-sys",
"bitflags",
"bitflags 1.3.2",
"libc",
"nix 0.24.99",
]
@ -248,7 +248,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd92208b8b0c2477d1123f9fa898e35d9f7d9340e3f26ddda27bf37a608eff99"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -325,7 +325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e73e25e6ae754b553f930c48af8f0e5ca71e641c419151e95bafd5644ff6e21b"
dependencies = [
"base64",
"bitflags",
"bitflags 1.3.2",
"cfg-if 1.0.0",
"core-foundation",
"devd-rs",
@ -336,7 +336,7 @@ dependencies = [
"nom",
"nss-gk-api",
"pkcs11-bindings",
"rand 0.8.5",
"rand",
"runloop",
"serde",
"serde_bytes",
@ -420,7 +420,7 @@ version = "0.64.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cexpr",
"clang-sys",
"lazy_static",
@ -455,6 +455,13 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.999.999"
dependencies = [
"bitflags 1.3.2",
]
[[package]]
name = "bitreader"
version = "0.3.6"
@ -484,7 +491,7 @@ dependencies = [
"comedy",
"guid_win",
"lazy_static",
"rand 0.8.5",
"rand",
"regex",
"tempfile",
"thiserror",
@ -733,7 +740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b"
dependencies = [
"atty",
"bitflags",
"bitflags 1.3.2",
"clap_derive",
"clap_lex",
"indexmap",
@ -821,7 +828,7 @@ version = "0.22.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation",
"core-graphics-types",
"foreign-types",
@ -834,7 +841,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"core-foundation",
"foreign-types",
"libc",
@ -918,14 +925,13 @@ dependencies = [
[[package]]
name = "crash-context"
version = "0.5.1"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8bb7283a39cb25312513ccd35ce14098a4a8398e821a13130c76bb803c4a3b0"
checksum = "6d433b84b88830c0c253292a52fe43bd3f385668b6a39a84ce291e6e7db52724"
dependencies = [
"cfg-if 1.0.0",
"libc",
"mach2",
"winapi",
]
[[package]]
@ -1064,7 +1070,7 @@ version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6203cd567a2ae4382077cc2160738517462c93cf77f3910fa18b2a74549abc84"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cubeb-sys",
]
@ -1075,7 +1081,7 @@ source = "git+https://github.com/mozilla/cubeb-coreaudio-rs?rev=93b5c01a131f65c8
dependencies = [
"atomic",
"audio-mixer",
"bitflags",
"bitflags 1.3.2",
"coreaudio-sys-utils",
"cubeb-backend",
"float-cmp",
@ -1113,7 +1119,7 @@ name = "d3d12"
version = "0.6.0"
source = "git+https://github.com/gfx-rs/d3d12-rs?rev=b940b1d71#b940b1d71ab7083ae80eec697872672dc1f2bd32"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"libloading",
"winapi",
]
@ -1123,7 +1129,7 @@ name = "dap_ffi"
version = "0.1.0"
dependencies = [
"prio",
"rand 0.8.5",
"rand",
"thin-vec",
]
@ -1357,7 +1363,7 @@ dependencies = [
name = "dom"
version = "0.1.0"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -1823,7 +1829,7 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"fuchsia-zircon-sys",
]
@ -2304,7 +2310,7 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"gpu-alloc-types",
]
@ -2314,7 +2320,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -2323,7 +2329,7 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"gpu-descriptor-types",
"hashbrown",
]
@ -2334,7 +2340,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -2397,7 +2403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584"
dependencies = [
"base64",
"bitflags",
"bitflags 1.3.2",
"bytes",
"headers-core",
"http",
@ -2970,7 +2976,7 @@ version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "447a296f7aca299cfbb50f4e4f3d49451549af655fb7215d7f8c0c3d64bad42b"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"byteorder",
"libc",
"lmdb-rkv-sys",
@ -3160,7 +3166,7 @@ version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"block",
"core-graphics-types",
"foreign-types",
@ -3174,7 +3180,7 @@ version = "0.7.0"
source = "git+https://github.com/mozilla/midir.git?rev=519e651241e867af3391db08f9ae6400bc023e18#519e651241e867af3391db08f9ae6400bc023e18"
dependencies = [
"alsa",
"bitflags",
"bitflags 1.3.2",
"coremidi",
"js-sys",
"libc",
@ -3216,7 +3222,7 @@ version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "694717103b2c15f8c16ddfaec1333fe15673bc22b10ffa6164427415701974ba"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"debugid",
"enum-primitive-derive",
"num-traits",
@ -3227,9 +3233,11 @@ dependencies = [
[[package]]
name = "minidump-writer"
version = "0.7.0"
source = "git+https://github.com/rust-minidump/minidump-writer.git?rev=59179c83ba62e4378619c6967c0b8c0c077cac2d#59179c83ba62e4378619c6967c0b8c0c077cac2d"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8109e02c3cf4a587eea0bec18ccdfecc9041f91b5ebffa223b1e692c9a223c26"
dependencies = [
"bitflags 2.999.999",
"byteorder",
"cfg-if 1.0.0",
"crash-context",
@ -3243,7 +3251,6 @@ dependencies = [
"scroll",
"tempfile",
"thiserror",
"winapi",
]
[[package]]
@ -3481,7 +3488,7 @@ version = "0.11.0"
source = "git+https://github.com/gfx-rs/naga?rev=9742f1616c3e3dd2cc9a5880616fc886c391bb9f#9742f1616c3e3dd2cc9a5880616fc886c391bb9f"
dependencies = [
"bit-set",
"bitflags",
"bitflags 1.3.2",
"codespan-reporting",
"hexf-parse",
"indexmap",
@ -3627,7 +3634,7 @@ version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cfg-if 1.0.0",
"libc",
"static_assertions",
@ -3675,7 +3682,7 @@ source = "git+https://github.com/mozilla/application-services?rev=86c84c217036c1
name = "nsstring"
version = "0.1.0"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"encoding_rs",
]
@ -3776,7 +3783,7 @@ version = "0.1.0"
dependencies = [
"nserror",
"ohttp",
"rand 0.8.5",
"rand",
"thin-vec",
"xpcom",
]
@ -3979,7 +3986,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
dependencies = [
"phf_shared",
"rand 0.8.5",
"rand",
]
[[package]]
@ -4215,7 +4222,7 @@ name = "pulse"
version = "0.3.0"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=cf48897be5cbe147d051ebbbe1eaf5fd8fb6bbc9#cf48897be5cbe147d051ebbbe1eaf5fd8fb6bbc9"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"pulse-ffi",
]
@ -4261,13 +4268,6 @@ dependencies = [
"proc-macro2",
]
[[package]]
name = "rand"
version = "0.7.999"
dependencies = [
"rand 0.8.5",
]
[[package]]
name = "rand"
version = "0.8.5"
@ -4350,7 +4350,7 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
]
[[package]]
@ -4406,7 +4406,7 @@ checksum = "9f0ea3af1393b22f8fe25615b6fa5d13072b7b622e66acffc8b12b2baa0342b1"
dependencies = [
"arrayref",
"bincode",
"bitflags",
"bitflags 1.3.2",
"byteorder",
"id-arena",
"lazy_static",
@ -4428,7 +4428,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff"
dependencies = [
"base64",
"bitflags",
"bitflags 1.3.2",
"serde",
]
@ -4470,7 +4470,7 @@ version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"fallible-iterator",
"fallible-streaming-iterator",
"hashlink",
@ -4487,13 +4487,13 @@ checksum = "8a654c5bda722c699be6b0fe4c0d90de218928da5b724c3e467fc48865c37263"
[[package]]
name = "rust_cascade"
version = "1.4.0"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef248456c30c6607f1eb1e5d11025367b3340e235314dd33d2b31b41b35ac335"
checksum = "04249959e1b66d36f746f45ca8d0eed17cdc30c30aad178a856b7c45d51fe127"
dependencies = [
"byteorder",
"murmurhash3",
"rand 0.7.999",
"rand",
"sha2",
]
@ -4602,7 +4602,7 @@ dependencies = [
name = "selectors"
version = "0.22.0"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"cssparser",
"derive_more",
"fxhash",
@ -4887,7 +4887,7 @@ version = "0.2.0+1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"num-traits",
]
@ -4961,7 +4961,7 @@ dependencies = [
"arrayvec",
"atomic_refcell",
"bindgen 0.64.0",
"bitflags",
"bitflags 1.3.2",
"byteorder",
"cssparser",
"derive_more",
@ -5026,7 +5026,7 @@ name = "style_traits"
version = "0.0.1"
dependencies = [
"app_units",
"bitflags",
"bitflags 1.3.2",
"cssparser",
"euclid",
"lazy_static",
@ -5080,7 +5080,7 @@ version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=86c84c217036c12283d19368867323a66bf35883#86c84c217036c12283d19368867323a66bf35883"
dependencies = [
"base64",
"rand 0.8.5",
"rand",
"rusqlite",
"serde",
]
@ -6008,7 +6008,7 @@ name = "webrender"
version = "0.62.0"
dependencies = [
"bincode",
"bitflags",
"bitflags 1.3.2",
"build-parallel",
"byteorder",
"derive_more",
@ -6045,7 +6045,7 @@ name = "webrender_api"
version = "0.62.0"
dependencies = [
"app_units",
"bitflags",
"bitflags 1.3.2",
"byteorder",
"crossbeam-channel",
"euclid",
@ -6092,7 +6092,7 @@ dependencies = [
name = "webrender_build"
version = "0.0.2"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"lazy_static",
"serde",
]
@ -6123,7 +6123,7 @@ source = "git+https://github.com/gfx-rs/wgpu?rev=73b4257b17cc62ecc8df6d6aa3730bd
dependencies = [
"arrayvec",
"bit-vec",
"bitflags",
"bitflags 1.3.2",
"codespan-reporting",
"fxhash",
"log",
@ -6148,7 +6148,7 @@ dependencies = [
"arrayvec",
"ash",
"bit-set",
"bitflags",
"bitflags 1.3.2",
"block",
"core-graphics-types",
"d3d12",
@ -6181,7 +6181,7 @@ name = "wgpu-types"
version = "0.15.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=73b4257b17cc62ecc8df6d6aa3730bd9c6cba4b9#73b4257b17cc62ecc8df6d6aa3730bd9c6cba4b9"
dependencies = [
"bitflags",
"bitflags 1.3.2",
"js-sys",
"serde",
"web-sys",

View file

@ -93,6 +93,9 @@ vcpkg = { path = "build/rust/vcpkg" }
# Helper crate for integration in the gecko build system.
mozbuild = { path = "build/rust/mozbuild" }
# Patch bitflags 2.0 to 1.0 while not too many crates use 2.0 features
bitflags = { path = "build/rust/bitflags" }
# Patch cfg-if 0.1 to 1.0
cfg-if = { path = "build/rust/cfg-if" }
@ -102,9 +105,6 @@ darling = { path = "build/rust/darling" }
# Patch redox_users to an empty crate
redox_users = { path = "build/rust/redox_users" }
# Patch getrandom 0.7 to 0.8
rand = { path = "build/rust/rand" }
# Patch env_logger 0.9 to 0.10
env_logger = { path = "build/rust/env_logger" }
@ -160,7 +160,6 @@ firefox-on-glean = { path = "toolkit/components/glean/api" }
libudev-sys = { path = "dom/webauthn/libudev-sys" }
packed_simd = { package = "packed_simd_2", git = "https://github.com/hsivonen/packed_simd", rev="412f9a0aa556611de021bde89dee8fefe6e0fbbd" }
midir = { git = "https://github.com/mozilla/midir.git", rev = "519e651241e867af3391db08f9ae6400bc023e18" }
minidump-writer = { git = "https://github.com/rust-minidump/minidump-writer.git", rev = "59179c83ba62e4378619c6967c0b8c0c077cac2d" }
# warp 0.3.3 + https://github.com/seanmonstar/warp/pull/1007
warp = { git = "https://github.com/glandium/warp", rev = "4af45fae95bc98b0eba1ef0db17e1dac471bb23d" }

View file

@ -643,8 +643,12 @@ var gXPInstallObserver = {
let hasHost = !!options.displayURI;
if (isSitePermissionAddon) {
// At present, WebMIDI is the only consumer of the site permission
// add-on infrastructure, and so we can hard-code a midi string here.
// If and when we use it for other things, we'll need to plumb that
// information through. See bug 1826747.
messageString = gNavigatorBundle.getString(
"sitePermissionInstallFirstPrompt.header"
"sitePermissionInstallFirstPrompt.midi.header"
);
} else if (hasHost) {
messageString = gNavigatorBundle.getFormattedString(
@ -675,7 +679,7 @@ var gXPInstallObserver = {
if (isSitePermissionAddon) {
message.textContent = gNavigatorBundle.getString(
"sitePermissionInstallFirstPrompt.message"
"sitePermissionInstallFirstPrompt.midi.message"
);
} else if (hasHost) {
let text = gNavigatorBundle.getString(

View file

@ -166,7 +166,6 @@ var gIdentityHandler = {
_popupInitialized: false,
_initializePopup() {
window.ensureCustomElements("moz-support-link");
if (!this._popupInitialized) {
let wrapper = document.getElementById("template-identity-popup");
wrapper.replaceWith(wrapper.content);
@ -929,6 +928,9 @@ var gIdentityHandler = {
// Update "Learn More" for Mixed Content Blocking and Insecure Login Forms.
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
this._identityPopupMixedContentLearnMore.forEach(e =>
e.setAttribute("href", baseURL + "mixed-content")
);
this._identityPopupCustomRootLearnMore.setAttribute(
"href",

View file

@ -4,8 +4,8 @@ const { PlacesTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PlacesTestUtils.sys.mjs"
);
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
let notificationURL =

View file

@ -1,7 +1,7 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
var tab;

View file

@ -4,8 +4,8 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
var tab;

View file

@ -2,8 +2,8 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const testPath = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",

View file

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
add_task(async function test() {

View file

@ -5,8 +5,8 @@
var { WebChannel } = ChromeUtils.importESModule(
"resource://gre/modules/WebChannel.sys.mjs"
);
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const TEST_URL_TAIL =

View file

@ -1,5 +1,5 @@
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const TEST_ORIGIN = "https://example.com";

View file

@ -1,5 +1,5 @@
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
SpecialPowers.addTaskImport(

View file

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const baseURL = getRootDirectory(gTestPath).replace(

View file

@ -9,8 +9,8 @@
* enabled
*/
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const TEST_PAGE =

View file

@ -4,8 +4,8 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const TRACKING_PAGE =

View file

@ -4,8 +4,8 @@
const { SiteDataTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/SiteDataTestUtils.sys.mjs"
);
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const oneHour = 3600000000;

View file

@ -1,15 +1,12 @@
ChromeUtils.defineESModuleGetters(this, {
Downloads: "resource://gre/modules/Downloads.sys.mjs",
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
PermissionTestUtils: "resource://testing-common/PermissionTestUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
Sanitizer: "resource:///modules/Sanitizer.sys.mjs",
SiteDataTestUtils: "resource://testing-common/SiteDataTestUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
PermissionTestUtils: "resource://testing-common/PermissionTestUtils.jsm",
});
function createIndexedDB(host, originAttributes) {
let uri = Services.io.newURI("https://" + host);
let principal = Services.scriptSecurityManager.createContentPrincipal(

View file

@ -9,8 +9,8 @@ const { PermissionUI } = ChromeUtils.importESModule(
"resource:///modules/PermissionUI.sys.mjs"
);
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const CP = Cc["@mozilla.org/content-pref/service;1"].getService(

View file

@ -1,7 +1,7 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const ROOT = getRootDirectory(gTestPath).replace(

View file

@ -22,8 +22,8 @@ let { CustomizableUITestUtils } = ChromeUtils.import(
);
let gCUITestUtils = new CustomizableUITestUtils(window);
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
/**

View file

@ -1,5 +1,5 @@
var { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
var { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const PREF_PERMISSION_FAKE = "media.navigator.permission.fake";

View file

@ -147,25 +147,25 @@
<!-- Active Mixed Content Blocked -->
<description class="identity-popup-warning-box identity-popup-warning-gray"
when-mixedcontent="active-blocked">
<label data-l10n-id="identity-description-active-blocked2"/>
<html:a is="moz-support-link" class="identity-popup-mcb-learn-more" support-page="mixed-content"/>
when-mixedcontent="active-blocked"
data-l10n-id="identity-description-active-blocked">
<label data-l10n-name="link" is="text-link" class="identity-popup-mcb-learn-more"/>
</description>
<!-- Passive Mixed Content Loaded -->
<description when-mixedcontent="passive-loaded" data-l10n-id="identity-description-passive-loaded"></description>
<description class="identity-popup-warning-box identity-popup-warning-yellow"
when-mixedcontent="passive-loaded">
<label data-l10n-id="identity-description-passive-loaded-insecure2"/>
<html:a is="moz-support-link" class="identity-popup-mcb-learn-more" support-page="mixed-content"/>
when-mixedcontent="passive-loaded"
data-l10n-id="identity-description-passive-loaded-insecure">
<label data-l10n-name="link" is="text-link" class="identity-popup-mcb-learn-more"/>
</description>
<!-- Passive Mixed Content Loaded, Active Mixed Content Blocked -->
<description when-mixedcontent="passive-loaded active-blocked" data-l10n-id="identity-description-passive-loaded"></description>
<description when-mixedcontent="passive-loaded active-blocked"
class="identity-popup-warning-box identity-popup-warning-yellow">
<label data-l10n-id="identity-description-passive-loaded-mixed2"/>
<html:a is="moz-support-link" class="identity-popup-mcb-learn-more" support-page="mixed-content"/>
class="identity-popup-warning-box identity-popup-warning-yellow"
data-l10n-id="identity-description-passive-loaded-mixed">
<label data-l10n-name="link" is="text-link" class="identity-popup-mcb-learn-more"/>
</description>
<!-- Active Mixed Content Blocking Disabled -->
@ -174,8 +174,8 @@
<description when-mixedcontent="active-loaded"
data-l10n-id="identity-description-active-loaded-insecure"></description>
<hbox>
<html:a is="moz-support-link" when-mixedcontent="active-loaded"
and-when-loginforms="secure" class="identity-popup-mcb-learn-more" support-page="mixed-content"/>
<label when-mixedcontent="active-loaded"
and-when-loginforms="secure" is="text-link" class="identity-popup-mcb-learn-more" data-l10n-id="identity-learn-more"/>
</hbox>

View file

@ -6,11 +6,11 @@
ChromeUtils.defineESModuleGetters(this, {
DownloadSpamProtection: "resource:///modules/DownloadSpamProtection.sys.mjs",
PermissionTestUtils: "resource://testing-common/PermissionTestUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
PermissionTestUtils: "resource://testing-common/PermissionTestUtils.jsm",
});
const TEST_URI = "https://example.com";

View file

@ -18,8 +18,8 @@ const { updateAppInfo, getAppInfo } = ChromeUtils.importESModule(
const { FileTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/FileTestUtils.sys.mjs"
);
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
ChromeUtils.defineESModuleGetters(lazy, {
SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs",

View file

@ -2,8 +2,8 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
function openPermissionPopup() {

View file

@ -1,7 +1,7 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
add_setup(async function() {

View file

@ -1,7 +1,7 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const videoUrl =

View file

@ -4,8 +4,8 @@
* This test is testing the cookie "permission" for a specific URI.
*/
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const TEST_PAGE = "https://example.net";

View file

@ -1,8 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const kDefaultWait = 2000;

View file

@ -3,8 +3,8 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
async function testClearData(clearSiteData, clearCache) {

View file

@ -0,0 +1,79 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import React from "react";
import { addons } from "@storybook/addons";
// eslint-disable-next-line no-unused-vars
import { AddonPanel } from "@storybook/components";
import { FLUENT_CHANGED, FLUENT_SET_STRINGS } from "./constants.mjs";
export class FluentPanel extends React.Component {
constructor(props) {
super(props);
this.channel = addons.getChannel();
this.state = {
name: null,
strings: [],
};
}
componentDidMount() {
const { api } = this.props;
api.on(FLUENT_CHANGED, this.handleFluentChanged);
}
componentWillUnmount() {
const { api } = this.props;
api.off(FLUENT_CHANGED, this.handleFluentChanged);
}
handleFluentChanged = strings => {
let storyData = this.props.api.getCurrentStoryData();
let fileName = `${storyData.component}.ftl`;
this.setState(state => ({ ...state, strings, fileName }));
};
onInput = e => {
this.setState(state => {
let strings = [];
for (let [key, value] of state.strings) {
if (key == e.target.name) {
strings.push([key, e.target.value]);
} else {
strings.push([key, value]);
}
}
let stringified = strings
.map(([key, value]) => `${key} = ${value}`)
.join("\n");
this.channel.emit(FLUENT_SET_STRINGS, stringified);
const { fluentStrings } = this.props.api.getGlobals();
this.props.api.updateGlobals({
fluentStrings: { ...fluentStrings, [state.fileName]: strings },
});
return { ...state, strings };
});
};
render() {
const { api, active } = this.props;
const { strings } = this.state;
return (
<AddonPanel active={!!active} api={api}>
{strings.map(([identifier, value]) => (
<div key={identifier}>
<label>
{identifier} =
<textarea
name={identifier}
onInput={this.onInput}
defaultValue={value}
></textarea>
</label>
</div>
))}
</AddonPanel>
);
}
}

View file

@ -2,13 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable no-unused-vars */
// eslint-disable-next-line no-unused-vars
import React from "react";
import { useGlobals } from "@storybook/api";
import {
// eslint-disable-next-line no-unused-vars
Icons,
// eslint-disable-next-line no-unused-vars
IconButton,
// eslint-disable-next-line no-unused-vars
WithTooltip,
// eslint-disable-next-line no-unused-vars
TooltipLinkList,
} from "@storybook/components";
import { TOOL_ID, STRATEGY_DEFAULT, PSEUDO_STRATEGIES } from "./constants.mjs";

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
export const ADDON_ID = "addon-pseudo-localization";
export const PANEL_ID = `${ADDON_ID}/fluentPanel`;
export const TOOL_ID = `${ADDON_ID}/toolbarButton`;
export const STRATEGY_DEFAULT = "default";
@ -27,3 +28,5 @@ export const DIRECTION_BY_STRATEGY = {
};
export const UPDATE_STRATEGY_EVENT = "update-strategy";
export const FLUENT_SET_STRINGS = "fluent-set-strings";
export const FLUENT_CHANGED = "fluent-changed";

View file

@ -4,12 +4,16 @@
/** This file handles registering the Storybook addon */
// eslint-disable-next-line no-unused-vars
import React from "react";
import { addons, types } from "@storybook/addons";
import { ADDON_ID, TOOL_ID } from "../constants.mjs";
import { ADDON_ID, PANEL_ID, TOOL_ID } from "../constants.mjs";
import { PseudoLocalizationButton } from "../PseudoLocalizationButton.mjs";
// eslint-disable-next-line no-unused-vars
import { FluentPanel } from "../FluentPanel.mjs";
// Register the addon.
addons.register(ADDON_ID, () => {
addons.register(ADDON_ID, api => {
// Register the tool.
addons.add(TOOL_ID, {
type: types.TOOL,
@ -18,4 +22,13 @@ addons.register(ADDON_ID, () => {
match: ({ viewMode }) => !!(viewMode && viewMode.match(/^story$/)),
render: PseudoLocalizationButton,
});
addons.add(PANEL_ID, {
title: "Fluent",
//👇 Sets the type of UI element in Storybook
type: types.PANEL,
render: ({ active, key }) => (
<FluentPanel active={active} api={api} key={key}></FluentPanel>
),
});
});

View file

@ -7,13 +7,21 @@
* could combine multiple decorators, but for now we only need one.
*/
import { withPseudoLocalization } from "../withPseudoLocalization.mjs";
import {
withPseudoLocalization,
withFluentStrings,
} from "../withPseudoLocalization.mjs";
export const decorators = [withPseudoLocalization];
export const decorators = [withPseudoLocalization, withFluentStrings];
export const globalTypes = {
pseudoStrategy: {
name: "Pseudo l10n strategy",
description: "Provides text variants for testing different locales.",
defaultValue: "default",
},
fluentStrings: {
name: "Fluent string map for components",
description: "Mapping of component to fluent strings.",
defaultValue: {},
},
};

View file

@ -7,7 +7,9 @@ import {
DIRECTIONS,
DIRECTION_BY_STRATEGY,
UPDATE_STRATEGY_EVENT,
FLUENT_CHANGED,
} from "./constants.mjs";
import { provideFluent } from "../fluent-utils.mjs";
/**
* withPseudoLocalization is a Storybook decorator that handles emitting an
@ -43,3 +45,45 @@ export const withPseudoLocalization = (StoryFn, context) => {
return StoryFn();
};
/**
* withFluentStrings is a Storybook decorator that handles emitting an
* event to update the Fluent strings shown in the Fluent panel.
*
* @param {Function} StoryFn - Provided by Storybook, used to render the story.
* @param {Object} context - Provided by Storybook, data about the story.
* @returns {Function} StoryFn unmodified.
*/
export const withFluentStrings = (StoryFn, context) => {
const [{ fluentStrings }, updateGlobals] = useGlobals();
const channel = addons.getChannel();
const fileName = context.component + ".ftl";
let strings = [];
if (context.parameters?.fluent && fileName) {
if (fluentStrings.hasOwnProperty(fileName)) {
strings = fluentStrings[fileName];
} else {
let resource = provideFluent(context.parameters.fluent, fileName);
for (let message of resource.body) {
strings.push([
message.id,
[
message.value,
...Object.entries(message.attributes).map(
([key, value]) => ` .${key} = ${value}`
),
].join("\n"),
]);
}
updateGlobals({
fluentStrings: { ...fluentStrings, [fileName]: strings },
});
}
}
channel.emit(FLUENT_CHANGED, strings);
return StoryFn();
};

View file

@ -7,6 +7,7 @@ import { FluentBundle, FluentResource } from "@fluent/bundle";
import { addons } from "@storybook/addons";
import { PSEUDO_STRATEGY_TRANSFORMS } from "./l10n-pseudo.mjs";
import {
FLUENT_SET_STRINGS,
UPDATE_STRATEGY_EVENT,
STRATEGY_DEFAULT,
PSEUDO_STRATEGIES,
@ -26,6 +27,15 @@ let storybookBundle = new FluentBundle("en-US", {
// Listen for update events from addon-pseudo-localization.
const channel = addons.getChannel();
channel.on(UPDATE_STRATEGY_EVENT, updatePseudoStrategy);
channel.on(FLUENT_SET_STRINGS, ftlContents => {
let resource = new FluentResource(ftlContents);
for (let message of resource.body) {
let existingMessage = storybookBundle.getMessage(message.id);
existingMessage.value = message.value;
existingMessage.attributes = message.attributes;
}
document.l10n.translateRoots();
});
/**
* Updates "currentStrategy" when the selected pseudo localization strategy
@ -98,8 +108,15 @@ export async function insertFTLIfNeeded(fileName) {
return;
}
provideFluent(ftlContents, fileName);
}
export function provideFluent(ftlContents, fileName) {
let ftlResource = new FluentResource(ftlContents);
storybookBundle.addResource(ftlResource);
loadedResources.set(fileName, ftlResource);
if (fileName) {
loadedResources.set(fileName, ftlResource);
}
document.l10n.translateRoots();
return ftlResource;
}

View file

@ -9,20 +9,29 @@ import "toolkit-widgets/named-deck.js";
export default {
title: "Widgets/Functional/Button Group",
component: "button-group",
argTypes: {
orientation: {
options: ["horizontal", "vertical"],
control: { type: "radio" },
},
},
parameters: {
fluent: `
button-group-one = One
button-group-two = Two
button-group-three = Three
button-group-four = Four
`,
},
};
const Template = ({ orientation }) => html`
<button-group orientation=${orientation}>
<button>One</button>
<button>Two</button>
<button>Three</button>
<button>Four</button>
<button data-l10n-id="button-group-one"></button>
<button data-l10n-id="button-group-two"></button>
<button data-l10n-id="button-group-three"></button>
<button data-l10n-id="button-group-four"></button>
</button-group>
<p>

View file

@ -6,12 +6,21 @@ import { classMap, html } from "lit.all.mjs";
export default {
title: "Design System/Atoms/Button",
component: "button",
parameters: {
fluent: `
button-regular = Regular
button-primary = Primary
button-disabled = Disabled
button-danger = Danger
`,
},
};
const Template = ({
disabled,
primary,
text,
l10nId,
ghostButton,
icon,
dangerButton,
@ -30,33 +39,32 @@ const Template = ({
"icon-button": icon,
"danger-button": dangerButton,
})}
>
${text}
</button>
data-l10n-id=${l10nId}
></button>
`;
export const RegularButton = Template.bind({});
RegularButton.args = {
text: "Regular",
l10nId: "button-regular",
primary: false,
disabled: false,
};
export const PrimaryButton = Template.bind({});
PrimaryButton.args = {
text: "Primary",
l10nId: "button-primary",
primary: true,
disabled: false,
};
export const DisabledButton = Template.bind({});
DisabledButton.args = {
text: "Disabled",
l10nId: "button-disabled",
primary: false,
disabled: true,
};
export const DangerButton = Template.bind({});
DangerButton.args = {
text: "Danger",
l10nId: "button-danger",
primary: true,
disabled: false,
dangerButton: true,
@ -64,7 +72,6 @@ DangerButton.args = {
export const GhostIconButton = Template.bind({});
GhostIconButton.args = {
text: "",
icon: "chrome://browser/skin/login.svg",
disabled: false,
ghostButton: true,

View file

@ -9,6 +9,7 @@ import "../../aboutlogins/content/components/login-timeline.mjs";
export default {
title: "Widgets/Credential Management/Timeline",
component: "login-timeline",
};
window.MozXULElement.insertFTLIfNeeded("browser/aboutLogins.ftl");

View file

@ -16,6 +16,7 @@ const MESSAGE_TYPES = {
export default {
title: "Design System/Components/Message Bar",
component: "message-bar",
argTypes: {
type: {
options: Object.keys(MESSAGE_TYPES),
@ -23,13 +24,19 @@ export default {
control: { type: "select" },
},
},
parameters: {
fluent: `
message-bar-text = A very expressive and slightly whimsical message goes here.
message-bar-button = Click me, please!
`,
},
};
const Template = ({ dismissable, type }) =>
html`
<message-bar type=${type} ?dismissable=${dismissable}>
<span>A very expressive and slightly whimsical message goes here.</span>
<button>Click me, please!</button>
<span data-l10n-id="message-bar-text"></span>
<button data-l10n-id="message-bar-button"></button>
</message-bar>
`;

View file

@ -16,6 +16,7 @@ import "toolkit-widgets/named-deck.js";
export default {
title: "Design System/Components/Migration Wizard",
component: "migration-wizard",
};
const FAKE_BROWSER_LIST = [

View file

@ -9,6 +9,17 @@ import "toolkit-widgets/named-deck.js";
export default {
title: "Widgets/Functional/Named Deck",
component: "named-deck",
parameters: {
fluent: `
named-deck-tab-one = Tab 1
named-deck-tab-two = Tab 2
named-deck-tab-three = Tab 3
named-deck-content-one = This is tab 1
named-deck-content-two = This is tab 2
named-deck-content-three = This is tab 3
`,
},
};
export const Tabs = () => html`
@ -18,14 +29,14 @@ export const Tabs = () => html`
}
</style>
<button-group>
<button is="named-deck-button" deck="tabs-deck" name="tab-1">Tab 1</button>
<button is="named-deck-button" deck="tabs-deck" name="tab-2">Tab 2</button>
<button is="named-deck-button" deck="tabs-deck" name="tab-3">Tab 3</button>
<button is="named-deck-button" deck="tabs-deck" name="tab-1" data-l10n-id="named-deck-tab-one"></button>
<button is="named-deck-button" deck="tabs-deck" name="tab-2" data-l10n-id="named-deck-tab-two"></button>
<button is="named-deck-button" deck="tabs-deck" name="tab-3" data-l10n-id="named-deck-tab-three"></button>
</button-group>
<named-deck id="tabs-deck" is-tabbed>
<p name="tab-1">This is tab 1</p>
<p name="tab-2">This is tab 2</p>
<p name="tab-3">This is tab 3</p>
<p name="tab-1" data-l10n-id="named-deck-content-one"></p>
<p name="tab-2" data-l10n-id="named-deck-content-two"></p>
<p name="tab-3" data-l10n-id="named-deck-content-three"></p>
</named-deck>
<hr>

View file

@ -8,10 +8,20 @@ import { html, ifDefined } from "lit.all.mjs";
export default {
title: "Design System/Components/Panel Menu",
component: "panel-list",
parameters: {
actions: {
handles: ["click"],
},
fluent: `
panel-list-item-one = Item One
panel-list-item-two = Item Two (accesskey w)
panel-list-item-three = Item Three
panel-list-checked = Checked
panel-list-badged = Badged, look at me
panel-list-passwords = Passwords
panel-list-settings = Settings
`,
},
};
@ -82,9 +92,8 @@ const Template = ({ isOpen, items, wideAnchor }) =>
?checked=${i.checked}
?badged=${i.badged}
accesskey=${ifDefined(i.accesskey)}
>
${i.text ?? i}
</panel-item>
data-l10n-id=${i.l10nId ?? i}
></panel-item>
`
)}
</panel-list>
@ -95,12 +104,12 @@ Simple.args = {
isOpen: false,
wideAnchor: false,
items: [
"Item One",
{ text: "Item Two (accesskey w)", accesskey: "w" },
"Item Three",
"panel-list-item-one",
{ l10nId: "panel-list-item-two", accesskey: "w" },
"panel-list-item-three",
"<hr>",
{ text: "Checked", checked: true },
{ text: "Badged, look at me", badged: true, icon: "settings" },
{ l10nId: "panel-list-checked", checked: true },
{ l10nId: "panel-list-badged", badged: true, icon: "settings" },
],
};
@ -109,8 +118,8 @@ Icons.args = {
isOpen: false,
wideAnchor: false,
items: [
{ text: "Passwords", icon: "passwords" },
{ text: "Settings", icon: "settings" },
{ l10nId: "panel-list-passwords", icon: "passwords" },
{ l10nId: "panel-list-settings", icon: "settings" },
],
};

View file

@ -85,19 +85,28 @@ var gBuiltInInputs = {
title: "back",
image: "chrome://browser/skin/back.svg",
type: kInputTypes.BUTTON,
callback: () => execCommand("Browser:Back"),
callback: () => {
lazy.touchBarHelper.unfocusUrlbar();
execCommand("Browser:Back");
},
},
Forward: {
title: "forward",
image: "chrome://browser/skin/forward.svg",
type: kInputTypes.BUTTON,
callback: () => execCommand("Browser:Forward"),
callback: () => {
lazy.touchBarHelper.unfocusUrlbar();
execCommand("Browser:Forward");
},
},
Reload: {
title: "reload",
image: "chrome://global/skin/icons/reload.svg",
type: kInputTypes.BUTTON,
callback: () => execCommand("Browser:Reload"),
callback: () => {
lazy.touchBarHelper.unfocusUrlbar();
execCommand("Browser:Reload");
},
},
Home: {
title: "home",
@ -153,7 +162,7 @@ var gBuiltInInputs = {
title: "open-location",
image: "chrome://global/skin/icons/search-glass.svg",
type: kInputTypes.MAIN_BUTTON,
callback: () => execCommand("Browser:OpenLocation"),
callback: () => lazy.touchBarHelper.toggleFocusUrlbar(),
},
// This is a special-case `type: kInputTypes.SCRUBBER` element.
// Scrubbers are not yet generally implemented.
@ -316,6 +325,21 @@ class TouchBarHelper {
return TouchBarHelper.window.gURLBar.focused;
}
toggleFocusUrlbar() {
if (this.isUrlbarFocused) {
this.unfocusUrlbar();
} else {
execCommand("Browser:OpenLocation");
}
}
unfocusUrlbar() {
if (!this.isUrlbarFocused) {
return;
}
TouchBarHelper.window.gURLBar.blur();
}
static get baseWindow() {
return TouchBarHelper.window
? TouchBarHelper.window.docShell.treeOwner.QueryInterface(

View file

@ -8,6 +8,7 @@ XPCOMUtils.defineLazyServiceGetter(
"@mozilla.org/widget/touchbarhelper;1",
"nsITouchBarHelper"
);
XPCOMUtils.defineLazyServiceGetter(
this,
"TouchBarInput",
@ -119,6 +120,20 @@ add_task(async function updateMainButtonInFullscreen() {
);
});
add_task(async function toggleUrlbarFocusOnOpenLocation() {
Assert.equal(TouchBarHelper.isUrlbarFocused, false, "Urlbar is unfocused.");
TouchBarHelper.toggleFocusUrlbar();
Assert.equal(TouchBarHelper.isUrlbarFocused, true, "Urlbar is unfocused.");
TouchBarHelper.toggleFocusUrlbar();
});
add_task(async function unfocusUrlbar() {
window.gURLBar.focus();
Assert.equal(TouchBarHelper.isUrlbarFocused, true, "Urlbar is unfocused.");
TouchBarHelper.unfocusUrlbar();
Assert.equal(TouchBarHelper.isUrlbarFocused, false, "Urlbar is unfocused.");
});
function waitForFullScreenState(browser, state) {
info("inside waitforfullscreenstate");
return new Promise(resolve => {

View file

@ -4,8 +4,8 @@
// tests the translation infobar, using a fake 'Translation' implementation.
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const kLanguagesPref = "browser.translation.neverForLanguages";

View file

@ -7,8 +7,8 @@ ChromeUtils.defineESModuleGetters(this, {
UITour: "resource:///modules/UITour.sys.mjs",
});
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const SINGLE_TRY_TIMEOUT = 100;

View file

@ -408,12 +408,14 @@ identity-description-insecure = Your connection to this site is not private. Inf
identity-description-insecure-login-forms = The login information you enter on this page is not secure and could be compromised.
identity-description-weak-cipher-intro = Your connection to this website uses weak encryption and is not private.
identity-description-weak-cipher-risk = Other people can view your information or modify the websites behavior.
identity-description-active-blocked2 = { -brand-short-name } has blocked parts of this page that are not secure.
identity-description-active-blocked = { -brand-short-name } has blocked parts of this page that are not secure. <label data-l10n-name="link">Learn More</label>
identity-description-passive-loaded = Your connection is not private and information you share with the site could be viewed by others.
identity-description-passive-loaded-insecure2 = This website contains content that is not secure (such as images).
identity-description-passive-loaded-mixed2 = Although { -brand-short-name } has blocked some content, there is still content on the page that is not secure (such as images).
identity-description-passive-loaded-insecure = This website contains content that is not secure (such as images). <label data-l10n-name="link">Learn More</label>
identity-description-passive-loaded-mixed = Although { -brand-short-name } has blocked some content, there is still content on the page that is not secure (such as images). <label data-l10n-name="link">Learn More</label>
identity-description-active-loaded = This website contains content that is not secure (such as scripts) and your connection to it is not private.
identity-description-active-loaded-insecure = Information you share with this site could be viewed by others (like passwords, messages, credit cards, etc.).
identity-learn-more =
.value = Learn More
identity-disable-mixed-content-blocking =
.label = Disable protection for now
.accesskey = D

View file

@ -43,14 +43,12 @@ xpinstallPromptMessage.neverAllow.accesskey=N
# a localization that's significantly longer than the English version.
xpinstallPromptMessage.neverAllowAndReport=Report Suspicious Site
xpinstallPromptMessage.neverAllowAndReport.accesskey=R
# LOCALIZATION NOTE (sitePermissionInstallFirstPrompt.header)
# This message is shown when a SitePermissionsAddon install is triggered, i.e. when the
# website calls sensitive APIs (e.g. navigator.requestMIDIAccess).
sitePermissionInstallFirstPrompt.header=This site is requesting access to your devices. Device access can be enabled by installing an add-on.
# LOCALIZATION NOTE (sitePermissionInstallFirstPrompt.message)
# This message is shown when a SitePermissionsAddon install is triggered, i.e. when the
# website calls sensitive APIs (e.g. navigator.requestMIDIAccess).
sitePermissionInstallFirstPrompt.message=This add-on could be used to steal your data or attack your computer. Only continue if you trust this site.
# LOCALIZATION NOTE (sitePermissionInstallFirstPrompt.midi.header)
# This message is shown when a website invokes navigator.requestMIDIAccess.
sitePermissionInstallFirstPrompt.midi.header=This site is requesting access to your MIDI (Musical Instrument Digital Interface) devices. Device access can be enabled by installing an add-on.
# LOCALIZATION NOTE (sitePermissionInstallFirstPrompt.midi.message)
# This message is shown when a website invokes navigator.requestMIDIAccess.
sitePermissionInstallFirstPrompt.midi.message=This access is not guaranteed to be safe. Only continue if you trust this site.
# Accessibility Note:
# Be sure you do not choose an accesskey that is used elsewhere in the active context (e.g. main menu bar, submenu of the warning popup button)
@ -214,9 +212,9 @@ webextSitePerms.headerWithGatedPerms.midi-sysex=This add-on gives %S access to y
# LOCALIZATION NOTE (webextSitePerms.descriptionGatedPerms)
# This string is used as description in the webextension permissions dialog for synthetic add-ons.
# %S will be replaced by the DNS host name for which a webextension enables permissions
# Note, the \n\n is used to create a line break between the two sections.
# Note, this string will be used as raw markup. Avoid characters like <, >, &
webextSitePerms.descriptionGatedPerms=This access can be dangerous, and allows the site to act like software installed on your computer.
webextSitePerms.descriptionGatedPerms.midi=These are usually plug-in devices like audio synthesizers, but might also be built into your computer.\n\nWebsites are normally not allowed to access MIDI devices. Improper usage could cause damage or compromise security.
# These should remain in sync with permissions.NAME.label in sitePermissions.properties
webextSitePerms.description.midi=Access MIDI devices

View file

@ -123,7 +123,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "a2b4d095b72aa3259756afe32e3f428c9f97c0f4"
"revision": "588caf79b9ddca246b0c9e1560ec4d5321464ad8"
},
"bg": {
"pin": false,
@ -681,7 +681,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "4e2fa4edce57900c61e7474d60465b72068eabf9"
"revision": "a7908ee1e8ff2a106046fa09aa763aeabd28b810"
},
"ga-IE": {
"pin": false,
@ -969,7 +969,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "6fe1c2a767fb4d99d668ab22277ce38c0ee5298b"
"revision": "22146fa18280c6b5abec012a6771a933bd270a7c"
},
"ja": {
"pin": false,
@ -1137,7 +1137,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "fcde3a035bb9145aa3de06a94ddcde813745e53b"
"revision": "e9fbc84d9081023b45aa4a0a66c5a8f38c3e2910"
},
"lt": {
"pin": false,
@ -1605,7 +1605,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "edc7dcacdf01c753d3808fdac5de694db3aea0b1"
"revision": "136b72d42cb784ef721e523cfdc05a0be6ce898a"
},
"skr": {
"pin": false,

View file

@ -357,6 +357,15 @@ var ExtensionsUI = {
textEl.textContent = strings.text;
textEl.hidden = !strings.text;
// By default, multiline strings don't get formatted properly. These
// are presently only used in site permission add-ons, so we treat it
// as a special case to avoid unintended effects on other things.
let isMultiline = strings.text.includes("\n\n");
textEl.classList.toggle(
"addon-webext-perm-text-multiline",
isMultiline
);
let listIntroEl = doc.getElementById("addon-webext-perm-intro");
listIntroEl.textContent = strings.listIntro;
listIntroEl.hidden = !strings.msgs.length || !strings.listIntro;

View file

@ -10,8 +10,8 @@ const { PermissionUI } = ChromeUtils.importESModule(
"resource:///modules/PermissionUI.sys.mjs"
);
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
/**

View file

@ -9,8 +9,8 @@ const { SiteDataManager } = ChromeUtils.import(
const { SiteDataTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/SiteDataTestUtils.sys.mjs"
);
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const EXAMPLE_ORIGIN = "https://www.example.com";

View file

@ -28,6 +28,11 @@ html|*.addon-webext-perm-list {
margin-inline-start: 0;
}
.addon-webext-perm-text-multiline {
margin-top: 1em;
white-space: pre-line;
}
.popup-notification-description[popupid="addon-webext-permissions"],
.popup-notification-description[popupid="addon-webext-permissions-notification"] {
margin-inline-start: -1px;

View file

@ -268,10 +268,6 @@
font-weight: 600;
}
#identity-popup-securityView-extended-info > .identity-popup-warning-box > label {
display: inline-block;
}
#identity-popup-securityView-extended-info > button {
margin-inline: 0;
}

View file

@ -0,0 +1,11 @@
[package]
name = "bitflags"
version = "2.999.999"
edition = "2018"
license = "MPL-2.0"
[lib]
path = "lib.rs"
[dependencies.bitflags]
version = "1.0"

View file

@ -2,4 +2,4 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub use rand::*;
pub use bitflags::*;

View file

@ -1,22 +0,0 @@
[package]
name = "rand"
version = "0.7.999"
edition = "2018"
license = "MPL-2.0"
[lib]
path = "lib.rs"
[dependencies.rand]
version = "0.8"
default-features = false
[features]
alloc = ["rand/alloc"]
default = ["rand/default"]
getrandom = ["rand/getrandom"]
nightly = ["rand/nightly"]
serde1 = ["rand/serde1"]
simd_support = ["rand/simd_support"]
small_rng = ["rand/small_rng"]
std = ["rand/std"]

View file

@ -437,7 +437,10 @@ force-cargo-library-build:
$(REPORT_BUILD)
$(call CARGO_BUILD) --lib $(cargo_target_flag) $(rust_features_flag) -- $(cargo_rustc_flags)
$(RUST_LIBRARY_FILE): force-cargo-library-build
RUST_LIBRARY_DEP_FILE := $(basename $(RUST_LIBRARY_FILE)).d
RUST_LIBRARY_DEPS := $(wordlist 2, 10000000, $(if $(wildcard $(RUST_LIBRARY_DEP_FILE)),$(shell cat $(RUST_LIBRARY_DEP_FILE))))
$(RUST_LIBRARY_FILE): $(CARGO_FILE) $(if $(RUST_LIBRARY_DEPS),$(RUST_LIBRARY_DEPS), force-cargo-library-build)
$(if $(RUST_LIBRARY_DEPS),+$(MAKE) force-cargo-library-build,:)
# When we are building in --enable-release mode; we add an additional check to confirm
# that we are not importing any networking-related functions in rust code. This reduces
# the chance of proxy bypasses originating from rust code.

View file

@ -14923,7 +14923,7 @@ void Document::HidePopover(Element& aPopover, bool aFocusPreviousElement,
PopoverVisibilityState::Hidden);
// TODO: Queue popover toggle event task.
// TODO: Handle element focus.
popoverHTMLEl->HandleFocusAfterHidingPopover(aFocusPreviousElement);
}
nsTArray<Element*> Document::AutoPopoverList() const {

View file

@ -38,9 +38,20 @@ class PopoverData {
mVisibilityState = aVisibilityState;
}
nsWeakPtr GetPreviouslyFocusedElement() const {
return mPreviouslyFocusedElement;
}
void SetPreviouslyFocusedElement(nsWeakPtr aPreviouslyFocusedElement) {
mPreviouslyFocusedElement = aPreviouslyFocusedElement;
}
private:
PopoverVisibilityState mVisibilityState = PopoverVisibilityState::Hidden;
PopoverState mState = PopoverState::None;
// Popover and dialog don't share mPreviouslyFocusedElement for there are
// chances to lose the previously focused element.
// See, https://github.com/whatwg/html/issues/9063
nsWeakPtr mPreviouslyFocusedElement = nullptr;
};
} // namespace mozilla::dom

View file

@ -279,7 +279,10 @@ IPCResult FileSystemManagerParent::RecvGetFile(
}
}
RefPtr<BlobImpl> blob = MakeRefPtr<FileBlobImpl>(fileObject);
// TODO: Currently, there is no way to assign type and it is empty.
// See bug 1826780.
RefPtr<BlobImpl> blob =
MakeRefPtr<FileBlobImpl>(fileObject, path.LastElement(), type);
IPCBlob ipcBlob;
QM_TRY(MOZ_TO_RESULT(IPCBlobUtils::Serialize(blob, ipcBlob)), IPC_OK(),

View file

@ -3225,12 +3225,29 @@ void nsGenericHTMLElement::ShowPopover(ErrorResult& aRv) {
return;
}
// TODO: Run auto popover steps.
const bool shouldRestoreFocus = !OwnerDoc()->GetTopmostAutoPopover();
// Let originallyFocusedElement be document's focused area of the document's
// DOM anchor.
nsWeakPtr originallyFocusedElement;
if (Document* doc = GetComposedDoc()) {
if (nsIContent* unretargetedFocus = doc->GetUnretargetedFocusedContent()) {
originallyFocusedElement =
do_GetWeakReference(unretargetedFocus->AsElement());
}
}
// TODO: Add to Top Layer.
PopoverPseudoStateUpdate(true, true);
GetPopoverData()->SetPopoverVisibilityState(PopoverVisibilityState::Showing);
// TODO: Handle popover focusing.
// Run the popover focusing steps given element.
FocusPopover();
if (shouldRestoreFocus && GetPopoverState() != PopoverState::None) {
GetPopoverData()->SetPreviouslyFocusedElement(originallyFocusedElement);
}
// TODO: Queue popover toggle event task.
}
@ -3251,6 +3268,25 @@ void nsGenericHTMLElement::HidePopoverInternal(bool aFocusPreviousElement,
OwnerDoc()->HidePopover(*this, aFocusPreviousElement, aFireEvents, aRv);
}
void nsGenericHTMLElement::HandleFocusAfterHidingPopover(
bool aFocusPreviousElement) {
auto* data = GetPopoverData();
MOZ_ASSERT(data, "Should have popover data");
RefPtr<Element> control =
do_QueryReferent(data->GetPreviouslyFocusedElement().get());
data->SetPreviouslyFocusedElement(nullptr);
if (!control || !aFocusPreviousElement) {
return;
}
// Run the focusing steps for previouslyFocusedElement
FocusOptions options;
options.mPreventScroll = true;
control->Focus(options, CallerType::NonSystem, IgnoreErrors());
}
// https://html.spec.whatwg.org/multipage/popover.html#dom-togglepopover
void nsGenericHTMLElement::TogglePopover(bool force, ErrorResult& aRv) {
if (!force && PopoverOpen()) {

View file

@ -165,6 +165,8 @@ class nsGenericHTMLElement : public nsGenericHTMLElementBase {
MOZ_CAN_RUN_SCRIPT void HidePopover(ErrorResult& aRv);
MOZ_CAN_RUN_SCRIPT void TogglePopover(bool force, ErrorResult& aRv);
MOZ_CAN_RUN_SCRIPT void FocusPopover();
MOZ_CAN_RUN_SCRIPT void HandleFocusAfterHidingPopover(
bool aFocusPreviousElement);
MOZ_CAN_RUN_SCRIPT void FocusCandidate(Element&, bool aClearUpFocus);

View file

@ -6,8 +6,8 @@
*/
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
// We can't set site permission on 'about:blank' so we use an empty page.

View file

@ -4,8 +4,8 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const VIDEO_PAGE_URI = GetTestWebBasedURL("file_empty.html");

View file

@ -4,8 +4,8 @@
*/
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const VIDEO_PAGE = GetTestWebBasedURL("file_empty.html");

View file

@ -8,8 +8,8 @@
*/
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const PAGE = GetTestWebBasedURL("file_empty.html");

View file

@ -11,6 +11,7 @@
#include "gmp-entrypoints.h"
#include "prlink.h"
#include "prenv.h"
#include "prerror.h"
#if defined(XP_WIN) && defined(MOZ_SANDBOX)
# include "mozilla/sandboxTarget.h"
# include "mozilla/sandboxing/SandboxInitialization.h"
@ -117,7 +118,8 @@ bool GMPLoader::Load(const char* aUTF8LibPath, uint32_t aUTF8LibPathLen,
#endif
PRLibrary* lib = PR_LoadLibraryWithFlags(libSpec, 0);
if (!lib) {
MOZ_CRASH("Cannot load plugin as library!");
MOZ_CRASH_UNSAFE_PRINTF("Cannot load plugin as library %d %d",
PR_GetError(), PR_GetOSError());
return false;
}

View file

@ -92,12 +92,12 @@ add_task(async function testRequestMIDIAccess() {
);
is(
installPopupHeader.textContent,
gNavigatorBundle.getString("sitePermissionInstallFirstPrompt.header"),
gNavigatorBundle.getString("sitePermissionInstallFirstPrompt.midi.header"),
"First popup has expected header text"
);
is(
installPopupMessage.textContent,
gNavigatorBundle.getString("sitePermissionInstallFirstPrompt.message"),
gNavigatorBundle.getString("sitePermissionInstallFirstPrompt.midi.message"),
"First popup has expected message"
);
@ -153,7 +153,7 @@ add_task(async function testRequestMIDIAccess() {
installDialog.querySelector("popupnotificationcontent description")
.textContent,
gNavigatorBundle.getFormattedString(
"webextSitePerms.descriptionGatedPerms",
"webextSitePerms.descriptionGatedPerms.midi",
[testPageHost]
),
"Install dialog has expected description"
@ -299,7 +299,7 @@ add_task(async function testRequestMIDIAccess() {
installDialog.querySelector("popupnotificationcontent description")
.textContent,
gNavigatorBundle.getFormattedString(
"webextSitePerms.descriptionGatedPerms",
"webextSitePerms.descriptionGatedPerms.midi",
[testPageHost]
),
"Install dialog has expected description"

View file

@ -1,7 +1,7 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const ORIGIN_URI = Services.io.newURI("https://example.com");

View file

@ -8,6 +8,7 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
);
ChromeUtils.defineESModuleGetters(this, {
PermissionTestUtils: "resource://testing-common/PermissionTestUtils.sys.mjs",
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
Preferences: "resource://gre/modules/Preferences.sys.mjs",
@ -20,7 +21,6 @@ ChromeUtils.defineESModuleGetters(this, {
XPCOMUtils.defineLazyModuleGetters(this, {
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
PermissionTestUtils: "resource://testing-common/PermissionTestUtils.jsm",
});
var {
clearInterval,

View file

@ -1,7 +1,7 @@
"use strict";
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const BASE_URI = "http://mochi.test:8888/browser/dom/serviceworkers/test/";

View file

@ -7,7 +7,7 @@
TEST_DIRS += ["test"]
TESTING_JS_MODULES += [
"test/PermissionTestUtils.jsm",
"test/PermissionTestUtils.sys.mjs",
]
EXPORTS.mozilla += [

View file

@ -6,17 +6,14 @@
* with uri or origin string parameters.
*/
"use strict";
let pm = Services.perms;
let secMan = Services.scriptSecurityManager;
const EXPORTED_SYMBOLS = ["PermissionTestUtils"];
/**
* Convert origin string or uri to principal.
* If passed an nsIPrincipal it will be returned without conversion.
*
* @param {Ci.nsIPrincipal|Ci.nsIURI|string} subject - Subject to convert to principal
* @returns {Ci.nsIPrincipal} Principal created from subject
*/
@ -35,10 +32,11 @@ function convertToPrincipal(subject) {
);
}
let PermissionTestUtils = {
export let PermissionTestUtils = {
/**
* Add permission information for a given subject.
* Subject can be a principal, uri or origin string.
*
* @see nsIPermissionManager for documentation
*
* @param {Ci.nsIPrincipal|Ci.nsIURI|string} subject
@ -50,6 +48,7 @@ let PermissionTestUtils = {
/**
* Get all custom permissions for a given subject.
* Subject can be a principal, uri or origin string.
*
* @see nsIPermissionManager for documentation
*
* @param {Ci.nsIPrincipal|Ci.nsIURI|string} subject
@ -61,6 +60,7 @@ let PermissionTestUtils = {
/**
* Remove permission information for a given subject and permission type
* Subject can be a principal, uri or origin string.
*
* @see nsIPermissionManager for documentation
*
* @param {Ci.nsIPrincipal|Ci.nsIURI|string} subject
@ -72,6 +72,7 @@ let PermissionTestUtils = {
/**
* Test whether a website has permission to perform the given action.
* Subject can be a principal, uri or origin string.
*
* @see nsIPermissionManager for documentation
*
* @param {Ci.nsIPrincipal|Ci.nsIURI|string} subject
@ -83,6 +84,7 @@ let PermissionTestUtils = {
/**
* Test whether a website has permission to perform the given action.
* Subject can be a principal, uri or origin string.
*
* @see nsIPermissionManager for documentation
*
* @param {Ci.nsIPrincipal|Ci.nsIURI|string} subject
@ -97,6 +99,7 @@ let PermissionTestUtils = {
/**
* Get the permission object associated with the given subject and action.
* Subject can be a principal, uri or origin string.
*
* @see nsIPermissionManager for documentation
*
* @param {Ci.nsIPrincipal|Ci.nsIURI|string} subject

View file

@ -1,5 +1,5 @@
const { PermissionTestUtils } = ChromeUtils.import(
"resource://testing-common/PermissionTestUtils.jsm"
const { PermissionTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PermissionTestUtils.sys.mjs"
);
const BEHAVIOR_ACCEPT = Ci.nsICookieService.BEHAVIOR_ACCEPT;

View file

@ -1051,8 +1051,7 @@ fm
// fo : https://en.wikipedia.org/wiki/.fo
fo
// fr : http://www.afnic.fr/
// domaines descriptifs : https://www.afnic.fr/medias/documents/Cadre_legal/Afnic_Naming_Policy_12122016_VEN.pdf
// fr : https://www.afnic.fr/ https://www.afnic.fr/wp-media/uploads/2022/12/afnic-naming-policy-2023-01-01.pdf
fr
asso.fr
com.fr
@ -1060,7 +1059,7 @@ gouv.fr
nom.fr
prd.fr
tm.fr
// domaines sectoriels : https://www.afnic.fr/en/products-and-services/the-fr-tld/sector-based-fr-domains-4.html
// Former "domaines sectoriels", still registration suffixes
aeroport.fr
avocat.fr
avoues.fr
@ -4070,555 +4069,8 @@ ac.mu
co.mu
or.mu
// museum : http://about.museum/naming/
// http://index.museum/
// museum : https://welcome.museum/wp-content/uploads/2018/05/20180525-Registration-Policy-MUSEUM-EN_VF-2.pdf https://welcome.museum/buy-your-dot-museum-2/
museum
academy.museum
agriculture.museum
air.museum
airguard.museum
alabama.museum
alaska.museum
amber.museum
ambulance.museum
american.museum
americana.museum
americanantiques.museum
americanart.museum
amsterdam.museum
and.museum
annefrank.museum
anthro.museum
anthropology.museum
antiques.museum
aquarium.museum
arboretum.museum
archaeological.museum
archaeology.museum
architecture.museum
art.museum
artanddesign.museum
artcenter.museum
artdeco.museum
arteducation.museum
artgallery.museum
arts.museum
artsandcrafts.museum
asmatart.museum
assassination.museum
assisi.museum
association.museum
astronomy.museum
atlanta.museum
austin.museum
australia.museum
automotive.museum
aviation.museum
axis.museum
badajoz.museum
baghdad.museum
bahn.museum
bale.museum
baltimore.museum
barcelona.museum
baseball.museum
basel.museum
baths.museum
bauern.museum
beauxarts.museum
beeldengeluid.museum
bellevue.museum
bergbau.museum
berkeley.museum
berlin.museum
bern.museum
bible.museum
bilbao.museum
bill.museum
birdart.museum
birthplace.museum
bonn.museum
boston.museum
botanical.museum
botanicalgarden.museum
botanicgarden.museum
botany.museum
brandywinevalley.museum
brasil.museum
bristol.museum
british.museum
britishcolumbia.museum
broadcast.museum
brunel.museum
brussel.museum
brussels.museum
bruxelles.museum
building.museum
burghof.museum
bus.museum
bushey.museum
cadaques.museum
california.museum
cambridge.museum
can.museum
canada.museum
capebreton.museum
carrier.museum
cartoonart.museum
casadelamoneda.museum
castle.museum
castres.museum
celtic.museum
center.museum
chattanooga.museum
cheltenham.museum
chesapeakebay.museum
chicago.museum
children.museum
childrens.museum
childrensgarden.museum
chiropractic.museum
chocolate.museum
christiansburg.museum
cincinnati.museum
cinema.museum
circus.museum
civilisation.museum
civilization.museum
civilwar.museum
clinton.museum
clock.museum
coal.museum
coastaldefence.museum
cody.museum
coldwar.museum
collection.museum
colonialwilliamsburg.museum
coloradoplateau.museum
columbia.museum
columbus.museum
communication.museum
communications.museum
community.museum
computer.museum
computerhistory.museum
comunicações.museum
contemporary.museum
contemporaryart.museum
convent.museum
copenhagen.museum
corporation.museum
correios-e-telecomunicações.museum
corvette.museum
costume.museum
countryestate.museum
county.museum
crafts.museum
cranbrook.museum
creation.museum
cultural.museum
culturalcenter.museum
culture.museum
cyber.museum
cymru.museum
dali.museum
dallas.museum
database.museum
ddr.museum
decorativearts.museum
delaware.museum
delmenhorst.museum
denmark.museum
depot.museum
design.museum
detroit.museum
dinosaur.museum
discovery.museum
dolls.museum
donostia.museum
durham.museum
eastafrica.museum
eastcoast.museum
education.museum
educational.museum
egyptian.museum
eisenbahn.museum
elburg.museum
elvendrell.museum
embroidery.museum
encyclopedic.museum
england.museum
entomology.museum
environment.museum
environmentalconservation.museum
epilepsy.museum
essex.museum
estate.museum
ethnology.museum
exeter.museum
exhibition.museum
family.museum
farm.museum
farmequipment.museum
farmers.museum
farmstead.museum
field.museum
figueres.museum
filatelia.museum
film.museum
fineart.museum
finearts.museum
finland.museum
flanders.museum
florida.museum
force.museum
fortmissoula.museum
fortworth.museum
foundation.museum
francaise.museum
frankfurt.museum
franziskaner.museum
freemasonry.museum
freiburg.museum
fribourg.museum
frog.museum
fundacio.museum
furniture.museum
gallery.museum
garden.museum
gateway.museum
geelvinck.museum
gemological.museum
geology.museum
georgia.museum
giessen.museum
glas.museum
glass.museum
gorge.museum
grandrapids.museum
graz.museum
guernsey.museum
halloffame.museum
hamburg.museum
handson.museum
harvestcelebration.museum
hawaii.museum
health.museum
heimatunduhren.museum
hellas.museum
helsinki.museum
hembygdsforbund.museum
heritage.museum
histoire.museum
historical.museum
historicalsociety.museum
historichouses.museum
historisch.museum
historisches.museum
history.museum
historyofscience.museum
horology.museum
house.museum
humanities.museum
illustration.museum
imageandsound.museum
indian.museum
indiana.museum
indianapolis.museum
indianmarket.museum
intelligence.museum
interactive.museum
iraq.museum
iron.museum
isleofman.museum
jamison.museum
jefferson.museum
jerusalem.museum
jewelry.museum
jewish.museum
jewishart.museum
jfk.museum
journalism.museum
judaica.museum
judygarland.museum
juedisches.museum
juif.museum
karate.museum
karikatur.museum
kids.museum
koebenhavn.museum
koeln.museum
kunst.museum
kunstsammlung.museum
kunstunddesign.museum
labor.museum
labour.museum
lajolla.museum
lancashire.museum
landes.museum
lans.museum
läns.museum
larsson.museum
lewismiller.museum
lincoln.museum
linz.museum
living.museum
livinghistory.museum
localhistory.museum
london.museum
losangeles.museum
louvre.museum
loyalist.museum
lucerne.museum
luxembourg.museum
luzern.museum
mad.museum
madrid.museum
mallorca.museum
manchester.museum
mansion.museum
mansions.museum
manx.museum
marburg.museum
maritime.museum
maritimo.museum
maryland.museum
marylhurst.museum
media.museum
medical.museum
medizinhistorisches.museum
meeres.museum
memorial.museum
mesaverde.museum
michigan.museum
midatlantic.museum
military.museum
mill.museum
miners.museum
mining.museum
minnesota.museum
missile.museum
missoula.museum
modern.museum
moma.museum
money.museum
monmouth.museum
monticello.museum
montreal.museum
moscow.museum
motorcycle.museum
muenchen.museum
muenster.museum
mulhouse.museum
muncie.museum
museet.museum
museumcenter.museum
museumvereniging.museum
music.museum
national.museum
nationalfirearms.museum
nationalheritage.museum
nativeamerican.museum
naturalhistory.museum
naturalhistorymuseum.museum
naturalsciences.museum
nature.museum
naturhistorisches.museum
natuurwetenschappen.museum
naumburg.museum
naval.museum
nebraska.museum
neues.museum
newhampshire.museum
newjersey.museum
newmexico.museum
newport.museum
newspaper.museum
newyork.museum
niepce.museum
norfolk.museum
north.museum
nrw.museum
nyc.museum
nyny.museum
oceanographic.museum
oceanographique.museum
omaha.museum
online.museum
ontario.museum
openair.museum
oregon.museum
oregontrail.museum
otago.museum
oxford.museum
pacific.museum
paderborn.museum
palace.museum
paleo.museum
palmsprings.museum
panama.museum
paris.museum
pasadena.museum
pharmacy.museum
philadelphia.museum
philadelphiaarea.museum
philately.museum
phoenix.museum
photography.museum
pilots.museum
pittsburgh.museum
planetarium.museum
plantation.museum
plants.museum
plaza.museum
portal.museum
portland.museum
portlligat.museum
posts-and-telecommunications.museum
preservation.museum
presidio.museum
press.museum
project.museum
public.museum
pubol.museum
quebec.museum
railroad.museum
railway.museum
research.museum
resistance.museum
riodejaneiro.museum
rochester.museum
rockart.museum
roma.museum
russia.museum
saintlouis.museum
salem.museum
salvadordali.museum
salzburg.museum
sandiego.museum
sanfrancisco.museum
santabarbara.museum
santacruz.museum
santafe.museum
saskatchewan.museum
satx.museum
savannahga.museum
schlesisches.museum
schoenbrunn.museum
schokoladen.museum
school.museum
schweiz.museum
science.museum
scienceandhistory.museum
scienceandindustry.museum
sciencecenter.museum
sciencecenters.museum
science-fiction.museum
sciencehistory.museum
sciences.museum
sciencesnaturelles.museum
scotland.museum
seaport.museum
settlement.museum
settlers.museum
shell.museum
sherbrooke.museum
sibenik.museum
silk.museum
ski.museum
skole.museum
society.museum
sologne.museum
soundandvision.museum
southcarolina.museum
southwest.museum
space.museum
spy.museum
square.museum
stadt.museum
stalbans.museum
starnberg.museum
state.museum
stateofdelaware.museum
station.museum
steam.museum
steiermark.museum
stjohn.museum
stockholm.museum
stpetersburg.museum
stuttgart.museum
suisse.museum
surgeonshall.museum
surrey.museum
svizzera.museum
sweden.museum
sydney.museum
tank.museum
tcm.museum
technology.museum
telekommunikation.museum
television.museum
texas.museum
textile.museum
theater.museum
time.museum
timekeeping.museum
topology.museum
torino.museum
touch.museum
town.museum
transport.museum
tree.museum
trolley.museum
trust.museum
trustee.museum
uhren.museum
ulm.museum
undersea.museum
university.museum
usa.museum
usantiques.museum
usarts.museum
uscountryestate.museum
usculture.museum
usdecorativearts.museum
usgarden.museum
ushistory.museum
ushuaia.museum
uslivinghistory.museum
utah.museum
uvic.museum
valley.museum
vantaa.museum
versailles.museum
viking.museum
village.museum
virginia.museum
virtual.museum
virtuel.museum
vlaanderen.museum
volkenkunde.museum
wales.museum
wallonie.museum
war.museum
washingtondc.museum
watchandclock.museum
watch-and-clock.museum
western.museum
westfalen.museum
whaling.museum
wildlife.museum
williamsburg.museum
windmill.museum
workshop.museum
york.museum
yorkshire.museum
yosemite.museum
youth.museum
zoological.museum
zoology.museum
ירושלים.museum
иком.museum
// mv : https://en.wikipedia.org/wiki/.mv
// "mv" included because, contra Wikipedia, google.mv exists.
@ -5861,7 +5313,7 @@ zarow.pl
zgora.pl
zgorzelec.pl
// pm : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf
// pm : https://www.afnic.fr/wp-media/uploads/2022/12/afnic-naming-policy-2023-01-01.pdf
pm
// pn : http://www.government.pn/PnRegistry/policies.htm
@ -5959,7 +5411,7 @@ net.qa
org.qa
sch.qa
// re : http://www.afnic.re/obtenir/chartes/nommage-re/annexe-descriptifs
// re : https://www.afnic.fr/wp-media/uploads/2022/12/afnic-naming-policy-2023-01-01.pdf
re
asso.re
com.re
@ -6216,7 +5668,7 @@ td
// http://www.telnic.org/
tel
// tf : https://en.wikipedia.org/wiki/.tf
// tf : https://www.afnic.fr/wp-media/uploads/2022/12/afnic-naming-policy-2023-01-01.pdf
tf
// tg : https://en.wikipedia.org/wiki/.tg
@ -6835,7 +6287,7 @@ edu.vu
net.vu
org.vu
// wf : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf
// wf : https://www.afnic.fr/wp-media/uploads/2022/12/afnic-naming-policy-2023-01-01.pdf
wf
// ws : https://en.wikipedia.org/wiki/.ws
@ -6847,7 +6299,7 @@ org.ws
gov.ws
edu.ws
// yt : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf
// yt : https://www.afnic.fr/wp-media/uploads/2022/12/afnic-naming-policy-2023-01-01.pdf
yt
// IDN ccTLDs
@ -13459,6 +12911,10 @@ qoto.io
// Submitted by Xavier De Cock <xdecock@gmail.com>
qualifioapp.com
// Quality Unit: https://qualityunit.com
// Submitted by Vasyl Tsalko <vtsalko@qualityunit.com>
ladesk.com
// QuickBackend: https://www.quickbackend.com
// Submitted by Dani Biro <dani@pymet.com>
qbuser.com

View file

@ -1,49 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import fluent.syntax.ast as FTL
from fluent.migrate.transforms import TransformPattern
class STRIP_LEARNMORE(TransformPattern):
# Used to remove `<a data-l10n-name="link">SOME TEXT</a>` from a string
def visit_TextElement(self, node):
link_start = node.value.find('<label data-l10n-name="link">')
if link_start != -1:
# Replace string up to the link, remove remaining spaces afterwards.
# Removing an extra character directly is not safe, as it could be
# punctuation.
node.value = node.value[:link_start].rstrip()
return node
def migrate(ctx):
"""Bug 1814261 - Use moz-support-link in the mixed-content section of the identity panel, part {index}."""
browser_ftl = "browser/browser/browser.ftl"
ctx.add_transforms(
browser_ftl,
browser_ftl,
[
FTL.Message(
id=FTL.Identifier("identity-description-active-blocked2"),
value=STRIP_LEARNMORE(
browser_ftl, "identity-description-active-blocked"
),
),
FTL.Message(
id=FTL.Identifier("identity-description-passive-loaded-insecure2"),
value=STRIP_LEARNMORE(
browser_ftl, "identity-description-passive-loaded-insecure"
),
),
FTL.Message(
id=FTL.Identifier("identity-description-passive-loaded-mixed2"),
value=STRIP_LEARNMORE(
browser_ftl, "identity-description-passive-loaded-mixed"
),
),
],
)

View file

@ -25,6 +25,7 @@ const defaultFilter = [
export class Target extends Domain {
#browserContextIds;
#discoverTargetFilter;
constructor(session) {
super(session);
@ -77,8 +78,24 @@ export class Target extends Domain {
}
setDiscoverTargets(options = {}) {
const { discover } = options;
const { discover, filter } = options;
const { targetList } = this.session.target;
if (typeof discover !== "boolean") {
throw new TypeError("discover: boolean value expected");
}
if (discover === false && filter !== undefined) {
throw new Error("filter: should not be present when discover is false");
}
// null filter should not be defaulted
const targetFilter = filter === undefined ? defaultFilter : filter;
this._validateTargetFilter(targetFilter);
// Store active filter for filtering in event listeners (targetCreated, targetDestroyed, targetInfoChanged)
this.#discoverTargetFilter = targetFilter;
if (discover) {
targetList.on("target-created", this._onTargetCreated);
targetList.on("target-destroyed", this._onTargetDestroyed);
@ -86,6 +103,7 @@ export class Target extends Domain {
targetList.off("target-created", this._onTargetCreated);
targetList.off("target-destroyed", this._onTargetDestroyed);
}
for (const target of targetList) {
this._onTargetCreated("target-created", target);
}
@ -248,11 +266,19 @@ export class Target extends Domain {
}
_onTargetCreated(eventName, target) {
if (!this._filterIncludesTarget(target, this.#discoverTargetFilter)) {
return;
}
const targetInfo = this._getTargetInfo(target);
this.emit("Target.targetCreated", { targetInfo });
}
_onTargetDestroyed(eventName, target) {
if (!this._filterIncludesTarget(target, this.#discoverTargetFilter)) {
return;
}
this.emit("Target.targetDestroyed", {
targetId: target.id,
});

View file

@ -199,23 +199,21 @@ function getTargets(CDP) {
});
}
// Wait for all Target.targetCreated events. One for each tab, plus the one
// for the main process target.
async function getDiscoveredTargets(Target) {
return new Promise(resolve => {
const targets = [];
// Wait for all Target.targetCreated events. One for each tab.
async function getDiscoveredTargets(Target, options = {}) {
const { discover = true, filter } = options;
const unsubscribe = Target.targetCreated(target => {
targets.push(target);
if (targets.length >= gBrowser.tabs.length + 1) {
unsubscribe();
resolve(targets);
}
});
Target.setDiscoverTargets({ discover: true });
const targets = [];
const unsubscribe = Target.targetCreated(target => {
targets.push(target.targetInfo);
});
await Target.setDiscoverTargets({
discover,
filter,
}).finally(() => unsubscribe());
return targets;
}
async function openTab(Target, options = {}) {

View file

@ -31,7 +31,7 @@ add_task(async function selectTabInOtherWindow({ client, tab }) {
const currentTargetId = target.id;
const targets = await getDiscoveredTargets(Target);
const filtered_targets = targets.filter(target => {
return target.targetInfo.targetId == currentTargetId;
return target.targetId == currentTargetId;
});
is(filtered_targets.length, 1, "The current target has been found");
const initialTarget = filtered_targets[0];
@ -60,7 +60,7 @@ add_task(async function selectTabInOtherWindow({ client, tab }) {
try {
is(newWindow, getFocusedNavigator(), "The new window is focused");
await Target.activateTarget({
targetId: initialTarget.targetInfo.targetId,
targetId: initialTarget.targetId,
});
is(
tab.ownerGlobal,

View file

@ -3,65 +3,252 @@
"use strict";
// These tests are a near copy of the tests for Target.getTargets, but using
// the `setDiscoverTargets` method and `targetCreated` events instead.
// Calling `setDiscoverTargets` with `discover: true` will dispatch a
// `targetCreated` event for all already opened tabs and NOT the browser target
// with the default filter.
const PAGE_TEST =
"https://example.com/browser/remote/cdp/test/browser/target/doc_test.html";
add_task(
async function mainTarget({ client }) {
async function discoverInvalidTypes({ client }) {
const { Target } = client;
const { targetInfo } = await new Promise(resolve => {
const unsubscribe = Target.targetCreated(target => {
if (target.targetInfo.type == "browser") {
unsubscribe();
resolve(target);
}
});
// Calling `setDiscoverTargets` will dispatch `targetCreated` event for all
// already opened tabs and the browser target.
Target.setDiscoverTargets({ discover: true });
});
for (const discover of [null, undefined, 1, "foo", [], {}]) {
info(`Checking discover with invalid value: ${discover}`);
ok(!!targetInfo, "Target info for main target has been found");
ok(!!targetInfo.targetId, "Main target has a non-empty target id");
is(targetInfo.type, "browser", "Type of target is browser");
let errorThrown = "";
try {
await Target.setDiscoverTargets({ discover });
} catch (e) {
errorThrown = e.message;
}
ok(
errorThrown.match(/discover: boolean value expected/),
`Discover fails for invalid type: ${discover}`
);
}
},
{ createTab: false }
);
add_task(async function pageTargets({ client, tab }) {
const { Target, target } = client;
add_task(
async function filterInvalid({ client }) {
const { Target } = client;
const currentTargetId = target.id;
const url = toDataURL("pageTargets");
await loadURL(url);
for (const filter of [null, true, 1, "foo", {}]) {
info(`Checking filter with invalid value: ${filter}`);
const targets = await new Promise(resolve => {
const targets = [];
const unsubscribe = Target.targetCreated(target => {
if (target.targetInfo.type == "page") {
targets.push(target);
// Return once all page targets have been discovered
if (targets.length == gBrowser.tabs.length) {
unsubscribe();
resolve(targets);
}
let errorThrown = "";
try {
await Target.setDiscoverTargets({ discover: true, filter });
} catch (e) {
errorThrown = e.message;
}
});
// Calling `setDiscoverTargets` will dispatch `targetCreated` event for all
// already opened tabs and the browser target.
Target.setDiscoverTargets({ discover: true });
});
ok(
errorThrown.match(/filter: array value expected/),
`Filter fails for invalid type: ${filter}`
);
}
// Get the current target
const filtered_targets = targets.filter(target => {
return target.targetInfo.targetId == currentTargetId;
});
is(filtered_targets.length, 1, "The current target has been found");
const { targetInfo } = filtered_targets[0];
for (const filterEntry of [null, undefined, true, 1, "foo", []]) {
info(`Checking filter entry with invalid value: ${filterEntry}`);
ok(!!targetInfo, "Target info for current tab has been found");
ok(!!targetInfo.targetId, "Page target has a non-empty target id");
is(targetInfo.type, "page", "Type of current target is 'page'");
is(targetInfo.url, url, "Page target has a non-empty target id");
});
let errorThrown = "";
try {
await Target.setDiscoverTargets({
discover: true,
filter: [filterEntry],
});
} catch (e) {
errorThrown = e.message;
}
ok(
errorThrown.match(/filter: object values expected in array/),
`Filter entry fails for invalid type: ${filterEntry}`
);
}
for (const type of [null, true, 1, [], {}]) {
info(`Checking filter entry with type as invalid value: ${type}`);
let errorThrown = "";
try {
await Target.setDiscoverTargets({
discover: true,
filter: [{ type }],
});
} catch (e) {
errorThrown = e.message;
}
ok(
errorThrown.match(/filter: type: string value expected/),
`Filter entry type fails for invalid type: ${type}`
);
}
for (const exclude of [null, 1, "foo", [], {}]) {
info(`Checking filter entry with exclude as invalid value: ${exclude}`);
let errorThrown = "";
try {
await Target.setDiscoverTargets({
discover: true,
filter: [{ exclude }],
});
} catch (e) {
errorThrown = e.message;
}
ok(
errorThrown.match(/filter: exclude: boolean value expected/),
`Filter entry exclude for invalid type: ${exclude}`
);
}
},
{ createTab: false }
);
add_task(
async function noFilterWithDiscoverFalse({ client }) {
const { Target } = client;
// Check filter cannot be given with discover: false
let errorThrown = "";
try {
await Target.setDiscoverTargets({
discover: false,
filter: [{}],
});
} catch (e) {
errorThrown = e.message;
}
ok(
errorThrown.match(/filter: should not be present when discover is false/),
`Error throw when given filter with discover false`
);
},
{ createTab: false }
);
add_task(
async function targetInfoValues({ client }) {
const { Target, target } = client;
await loadURL(PAGE_TEST);
const targets = await getDiscoveredTargets(Target);
Assert.equal(targets.length, 1, "Got expected amount of targets");
const targetInfo = targets[0];
is(targetInfo.id, target.id, "Got expected target id");
is(targetInfo.type, "page", "Got expected target type");
is(targetInfo.title, "Test Page", "Got expected target title");
is(targetInfo.url, PAGE_TEST, "Got expected target URL");
},
{ createTab: false }
);
add_task(
async function discoverEnabledAndMultipleTabs({ client }) {
const { Target, target } = client;
const { targetInfo: newTabTargetInfo } = await openTab(Target);
await loadURL(PAGE_TEST);
const targets = await getDiscoveredTargets(Target);
Assert.equal(targets.length, 2, "Got expected amount of targets");
const targetIds = targets.map(info => info.id);
ok(targetIds.includes(target.id), "Got expected original target id");
ok(targetIds.includes(newTabTargetInfo.id), "Got expected new target id");
},
{ createTab: false }
);
add_task(
async function allFilters({ client }) {
const { Target } = client;
await loadURL(PAGE_TEST);
for (const filter of [[{}], [{ type: "browser" }, { type: "page" }]]) {
// Blank/all filter so all targets are returned, including main process
const targets = await getDiscoveredTargets(Target, { filter });
is(targets.length, 2, "Got expected amount of targets with all filter");
const pageTarget = targets.find(info => info.type === "page");
ok(!!pageTarget, "Found page target in targets with all filter");
const mainProcessTarget = targets.find(info => info.type === "browser");
ok(
!!mainProcessTarget,
"Found main process target in targets with all filter"
);
}
},
{ createTab: false }
);
add_task(
async function pageOnlyFilters({ client }) {
const { Target } = client;
await loadURL(PAGE_TEST);
for (const filter of [
[{ type: "page" }],
[{ type: "browser", exclude: true }, { type: "page" }],
]) {
// Filter so only page targets are returned
// This returns same as default but pass our own custom filter to ensure
// these filters still return what they should
const targets = await getDiscoveredTargets(Target, { filter });
is(targets.length, 1, "Got expected amount of targets with page filter");
is(
targets[0].type,
"page",
"Got expected type 'page' of target from page filter"
);
}
},
{ createTab: false }
);
add_task(
async function browserOnlyFilters({ client }) {
const { Target } = client;
await loadURL(PAGE_TEST);
for (const filter of [
[{ type: "browser" }],
[{ type: "page", exclude: true }, {}],
]) {
// Filter so only main process target is returned
const targets = await getDiscoveredTargets(Target, { filter });
is(
targets.length,
1,
"Got expected amount of targets with browser only filter"
);
is(
targets[0].type,
"browser",
"Got expected type 'browser' of target from browser only filter"
);
}
},
{ createTab: false }
);

View file

@ -405,6 +405,7 @@ navigate.waitForNavigationCompleted = async function waitForNavigationCompleted(
}
},
{
errorMessage: "Navigation timed out",
timeout: driver.currentSession.timeouts.pageLoad,
}
).finally(() => {

View file

@ -208,11 +208,12 @@ export function TimedPromise(fn, options = {}) {
// Reject only if |throws| is given. Otherwise it is assumed that
// the user is OK with the promise timing out.
let bail = () => {
const message = `${errorMessage} after ${timeout} ms`;
if (throws !== null) {
let err = new throws(`${errorMessage} after ${timeout} ms`);
let err = new throws(message);
reject(err);
} else {
lazy.logger.warn(`${errorMessage} after ${timeout} ms`, trace);
lazy.logger.warn(message, trace);
resolve();
}
};

View file

@ -26,6 +26,7 @@ const ERRORS = new Set([
"NoSuchAlertError",
"NoSuchElementError",
"NoSuchFrameError",
"NoSuchHandleError",
"NoSuchNodeError",
"NoSuchScriptError",
"NoSuchShadowRootError",
@ -437,6 +438,16 @@ class NoSuchFrameError extends WebDriverError {
}
}
/**
* The handle of a strong object reference could not be found
*/
class NoSuchHandleError extends WebDriverError {
constructor(message) {
super(message);
this.status = "no such handle";
}
}
/**
* A node as given by its unique shared id could not be found within the cache
* of known nodes.
@ -559,6 +570,7 @@ const STATUSES = new Map([
["no such alert", NoSuchAlertError],
["no such element", NoSuchElementError],
["no such frame", NoSuchFrameError],
["no such handle", NoSuchHandleError],
["no such node", NoSuchNodeError],
["no such script", NoSuchScriptError],
["no such shadow root", NoSuchShadowRootError],

View file

@ -166,7 +166,10 @@ export class FirefoxTargetManager
}
async initialize(): Promise<void> {
await this.#connection.send('Target.setDiscoverTargets', {discover: true});
await this.#connection.send('Target.setDiscoverTargets', {
discover: true,
filter: [{}],
});
this.#targetsIdsForInit = new Set(this.#discoveredTargetsByTargetId.keys());
await this.#initializePromise;
}

View file

@ -276,7 +276,7 @@ export function deserialize(realm, serializedValue, options = {}) {
const object = realm.getObjectForHandle(handle);
if (!object) {
throw new lazy.error.InvalidArgumentError(
throw new lazy.error.NoSuchHandleError(
`Unable to find an object reference for "handle" ${handle}`
);
}

View file

@ -27,6 +27,13 @@ class InputModule extends Module {
);
const context = lazy.TabManager.getBrowsingContextById(contextId);
if (!context) {
throw new lazy.error.NoSuchFrameError(
`Browsing context with id ${contextId} not found`
);
}
// Bug 1821460: Fetch top-level browsing context.
await this.messageHandler.forwardCommand({
moduleName: "input",

View file

@ -19,6 +19,8 @@ class InputModule extends Module {
this.#actionState = null;
}
destroy() {}
async performActions(options) {
const { actions } = options;
if (this.#actionState === null) {

View file

@ -469,14 +469,14 @@ add_task(function test_deserializeLocalValuesByHandle() {
Assert.throws(
() => deserialize(realm2, remoteReference),
/InvalidArgumentError:/,
/NoSuchHandleError:/,
`Got expected error when using the wrong realm for deserialize`
);
realm1.removeObjectHandle(serializedValue.handle);
Assert.throws(
() => deserialize(realm1, remoteReference),
/InvalidArgumentError:/,
/NoSuchHandleError:/,
`Got expected error when after deleting the object handle`
);
}

View file

@ -1106,4 +1106,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1688988865662000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1689247960566000);

File diff suppressed because it is too large Load diff

View file

@ -313,6 +313,12 @@ criteria = "safe-to-deploy"
version = "0.6.3"
notes = "Another crate I own via contain-rs that is ancient and in maintenance mode but otherwise perfectly fine."
[[audits.bitflags]]
who = "Alex Franchuk <afranchuk@mozilla.com>"
criteria = "safe-to-deploy"
delta = "1.3.2 -> 2.0.2"
notes = "Removal of some unsafe code/methods. No changes to externals, just some refactoring (mostly internal)."
[[audits.block-buffer]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
@ -458,6 +464,16 @@ criteria = "safe-to-deploy"
version = "0.5.1"
notes = "Mozilla employees contributed to this crate and the remaining code was fully audited"
[[audits.crash-context]]
who = "Alex Franchuk <afranchuk@mozilla.com>"
criteria = "safe-to-deploy"
delta = "0.5.1 -> 0.6.0"
notes = """
There are few changes. The main change is the removal of `winapi` in favor of
manually-generated bindings (which are minimal). The few small bugfixes are
sound.
"""
[[audits.crossbeam-channel]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
@ -1408,6 +1424,12 @@ who = "Bobby Holley <bobbyholley@gmail.com>"
criteria = "safe-to-deploy"
delta = "0.7.0 -> 0.7.0@git:7d76616d27b9dc87fe3a94639b8b4f947d52a6aa"
[[audits.minidump-writer]]
who = "Alex Franchuk <afranchuk@mozilla.com>"
criteria = "safe-to-deploy"
delta = "0.7.0 -> 0.8.0"
notes = "The code in this crate was written or reviewed by Mozilla employees, the crate it evolved from was written specifically for gecko."
[[audits.miniz_oxide]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
@ -1952,6 +1974,11 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.27.0 -> 0.28.0"
[[audits.rust_cascade]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "1.4.0 -> 1.5.0"
[[audits.rust_decimal]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"

View file

@ -11,10 +11,7 @@ url = "https://raw.githubusercontent.com/bytecodealliance/wasmtime/main/supply-c
url = "https://raw.githubusercontent.com/EmbarkStudios/rust-ecosystem/main/audits.toml"
[imports.google]
url = [
"https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT",
"https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT",
]
url = "https://raw.githubusercontent.com/google/supply-chain/main/audits.toml"
[imports.isrg]
url = "https://raw.githubusercontent.com/divviup/libprio-rs/main/supply-chain/audits.toml"
@ -87,10 +84,6 @@ notes = "This is a first-party crate which is also published to crates.io. We ce
audit-as-crates-io = true
notes = "This is a pinned version of the upstream code, presumably to get a fix that hadn't been released yet. We should consider switching to the latest official release."
[policy.minidump-writer]
audit-as-crates-io = true
notes = "This is a pinned version of the upstream code, presumably to get a fix that hadn't been released yet. We should consider switching to the latest official release."
[policy."mio:0.6.23"]
audit-as-crates-io = true
notes = "Version 0.6.23 is a local fork of upstream which just twiddles some dependencies."
@ -276,10 +269,6 @@ criteria = "safe-to-deploy"
version = "1.0.9"
criteria = "safe-to-deploy"
[[exemptions.cargo-platform]]
version = "0.1.2"
criteria = "safe-to-deploy"
[[exemptions.cexpr]]
version = "0.6.0"
criteria = "safe-to-deploy"
@ -492,14 +481,6 @@ criteria = "safe-to-deploy"
version = "0.6.0"
criteria = "safe-to-deploy"
[[exemptions.foreign-types]]
version = "0.3.2"
criteria = "safe-to-deploy"
[[exemptions.foreign-types-shared]]
version = "0.1.1"
criteria = "safe-to-deploy"
[[exemptions.freetype]]
version = "0.7.0"
criteria = "safe-to-deploy"
@ -866,14 +847,6 @@ criteria = "safe-to-deploy"
version = "0.2.9"
criteria = "safe-to-deploy"
[[exemptions.pin-utils]]
version = "0.1.0"
criteria = "safe-to-deploy"
[[exemptions.pkg-config]]
version = "0.3.25"
criteria = "safe-to-deploy"
[[exemptions.plain]]
version = "0.2.3"
criteria = "safe-to-deploy"
@ -1070,10 +1043,6 @@ criteria = "safe-to-run"
version = "0.3.10"
criteria = "safe-to-deploy"
[[exemptions.slab]]
version = "0.4.6"
criteria = "safe-to-deploy"
[[exemptions.smallbitvec]]
version = "2.5.1"
criteria = "safe-to-deploy"

View file

@ -74,6 +74,12 @@ criteria = "safe-to-deploy"
version = "3.11.1"
notes = "I am the author of this crate."
[[audits.bytecode-alliance.audits.cargo-platform]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.1.2"
notes = "no build, no ambient capabilities, no unsafe"
[[audits.bytecode-alliance.audits.cc]]
who = "Alex Crichton <alex@alexcrichton.com>"
criteria = "safe-to-deploy"
@ -103,6 +109,17 @@ criteria = "safe-to-deploy"
version = "1.1.0"
notes = "I am the author of this crate."
[[audits.bytecode-alliance.audits.foreign-types]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.3.2"
notes = "This crate defined a macro-rules which creates wrappers working with FFI types. The implementation of this crate appears to be safe, but each use of this macro would need to be vetted for correctness as well."
[[audits.bytecode-alliance.audits.foreign-types-shared]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.1.1"
[[audits.bytecode-alliance.audits.form_urlencoded]]
who = "Alex Crichton <alex@alexcrichton.com>"
criteria = "safe-to-deploy"
@ -164,12 +181,29 @@ a few `unsafe` blocks related to utf-8 validation which are locally verifiable
as correct and otherwise this crate is good to go.
"""
[[audits.bytecode-alliance.audits.pin-utils]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.1.0"
[[audits.bytecode-alliance.audits.pkg-config]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.3.25"
notes = "This crate shells out to the pkg-config executable, but it appears to sanitize inputs reasonably."
[[audits.bytecode-alliance.audits.rustc-demangle]]
who = "Alex Crichton <alex@alexcrichton.com>"
criteria = "safe-to-deploy"
version = "0.1.21"
notes = "I am the author of this crate."
[[audits.bytecode-alliance.audits.slab]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
version = "0.4.6"
notes = "provides a datastructure implemented using std's Vec. all uses of unsafe are just delegating to the underlying unsafe Vec methods."
[[audits.bytecode-alliance.audits.unicase]]
who = "Alex Crichton <alex@alexcrichton.com>"
criteria = "safe-to-deploy"
@ -260,55 +294,55 @@ notes = """
`does-not-implement-crypto` is certified because this crate explicitly says
that the RNG here is not cryptographically secure.
"""
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.h2]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.3.14"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.http]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.2.8"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.http-body]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.4.5"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.httpdate]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "1.0.2"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.hyper]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.14.20"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.pin-project]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "1.0.12"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.pin-project-internal]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "1.0.12"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.serde_urlencoded]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.7.1"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.tokio-stream]]
who = "David Koloski <dkoloski@google.com>"
@ -321,43 +355,43 @@ aggregated-from = "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/th
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.3.2"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.tracing]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.1.35"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.tracing-attributes]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.1.22"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.tracing-core]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.1.29"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.try-lock]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.2.3"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.version_check]]
who = "George Burgess IV <gbiv@google.com>"
criteria = "safe-to-deploy"
version = "0.9.4"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.google.audits.want]]
who = "ChromeOS"
criteria = "safe-to-run"
version = "0.3.0"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT"
aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
[[audits.isrg.audits.block-buffer]]
who = "David Cook <dcook@divviup.org>"

View file

@ -33,6 +33,7 @@ job-defaults:
worker:
env:
MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE: system
use-system-python: false
run:
mozconfig-variant:
by-release-type:

View file

@ -611,7 +611,7 @@ cargo-vet:
fetch:
type: git
repo: https://github.com/mozilla/cargo-vet
revision: a73d9ed7d3f0483990cbd845412934ebd59cd0ca
revision: f86dfa11f76f3ec2da2d955a19e66a8d6aaf82bb
symbol-scrapers:
description: Linux distribution symbol scraper source

View file

@ -1,12 +1,16 @@
---
win:
target.crashreporter-symbols-full.tar.zst: shortest
sccache.log: shortest
linux:
target.crashreporter-symbols-full.tar.zst: shortest
sccache.log: shortest
macos:
target.crashreporter-symbols-full.tar.zst: shortest
sccache.log: shortest
android:
target.crashreporter-symbols-full.tar.zst: shortest
sccache.log: shortest

View file

@ -62,6 +62,7 @@ job_description_schema = Schema(
"optimization"
],
Optional("use-sccache"): task_description_schema["use-sccache"],
Optional("use-system-python"): bool,
Optional("priority"): task_description_schema["priority"],
# The "when" section contains descriptions of the circumstances under which
# this task should be included in the task graph. This will be converted
@ -241,6 +242,34 @@ def get_attribute(dict, key, attributes, attribute_name):
dict[key] = value
@transforms.add
def use_system_python(config, jobs):
for job in jobs:
if job.pop("use-system-python", True):
yield job
else:
fetches = job.setdefault("fetches", {})
toolchain = fetches.setdefault("toolchain", [])
moz_python_home = mozpath.join("fetches", "python")
if "win" in job["worker"]["os"]:
platform = "win64"
elif "linux" in job["worker"]["os"]:
platform = "linux64"
elif "macosx" in job["worker"]["os"]:
platform = "macosx64"
else:
raise ValueError("unexpected worker.os value {}".format(platform))
toolchain.append("{}-python".format(platform))
worker = job.setdefault("worker", {})
env = worker.setdefault("env", {})
env["MOZ_PYTHON_HOME"] = moz_python_home
yield job
@transforms.add
def use_fetches(config, jobs):
artifact_names = {}

Some files were not shown because too many files have changed in this diff Show more