Bug 1843790 - Part 8: Rewrite toolkit/modules/PrivateBrowsingUtils.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D183667
This commit is contained in:
Tooru Fujisawa 2023-07-18 23:06:33 +00:00
Родитель e08b2de358
Коммит 7493bd3c30
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -97,7 +97,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1123480
// Repeat procedure of plain text selection with private browsing
// disabled and enabled
const {PrivateBrowsingUtils} = ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
const {PrivateBrowsingUtils} = ChromeUtils.importESModule(
"resource://gre/modules/PrivateBrowsingUtils.sys.mjs"
);
for (let private of [false, true]) {
var win = window.browsingContext.topChromeWindow.open("about:blank", "_blank", "chrome, width=500, height=200" + (private ? ", private" : ""));
ok(win, private ? "should open private window" : "should open non-private window");

Просмотреть файл

@ -80,7 +80,9 @@
}
function RunTest() {
const {PrivateBrowsingUtils} = ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
const {PrivateBrowsingUtils} = ChromeUtils.importESModule(
"resource://gre/modules/PrivateBrowsingUtils.sys.mjs"
);
var win = window.browsingContext.topChromeWindow.open("about:blank", "_blank", "chrome, width=500, height=200");
ok(win, "should open window");