@unotest/web 0.53.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -477,13 +477,18 @@ declare function readLocalStorageItem(key: string): string | null;
477
477
  declare function writeDocumentHidden([hidden, announce]: [boolean, boolean]): void;
478
478
  /** Make the document's scripts see the app launched in `mode` (`standalone`
479
479
  * for one added to the home screen): `matchMedia('(display-mode: …)')`
480
- * answers for that mode, and `navigator.standalone` — where the engine
481
- * has it, as WebKit does — says whether it is standalone. No engine
480
+ * answers for that mode, and with `navigatorStandalone` (WebKit)
481
+ * `navigator.standalone` says whether it is standalone. The caller names
482
+ * the engine rather than the page probing for the property: Playwright's
483
+ * WebKit has it on macOS and not on Linux, where boxes run. No engine
482
484
  * emulates the feature itself, so CSS `@media (display-mode: …)` and a
483
485
  * query combining it with other features still see the browser; the
484
486
  * config reference says so. The answer is the real list object (listeners,
485
487
  * `onchange`) of a query that is always true or always false. */
486
- declare function writeDisplayMode(mode: string): void;
488
+ declare function writeDisplayMode(args: {
489
+ mode: string;
490
+ navigatorStandalone: boolean;
491
+ }): void;
487
492
  /** Read every identifying attribute off a live element (role inferred from
488
493
  * tag + ARIA, accname approximated). Returns a structured raw hint. */
489
494
  declare function inspectElementRaw(el: Element, args: {
@@ -2883,7 +2883,8 @@ function writeDocumentHidden([hidden, announce]) {
2883
2883
  if (!hidden) window.dispatchEvent(new FocusEvent("focus"));
2884
2884
  }
2885
2885
  __name(writeDocumentHidden, "writeDocumentHidden");
2886
- function writeDisplayMode(mode) {
2886
+ function writeDisplayMode(args) {
2887
+ const { mode } = args;
2887
2888
  globalThis.__name ??= (fn) => fn;
2888
2889
  const original = window.matchMedia.bind(window);
2889
2890
  function askedMode(query) {
@@ -2901,7 +2902,7 @@ function writeDisplayMode(mode) {
2901
2902
  Object.defineProperty(list, "media", { configurable: true, value: query });
2902
2903
  return list;
2903
2904
  };
2904
- if ("standalone" in navigator) {
2905
+ if (args.navigatorStandalone) {
2905
2906
  Object.defineProperty(navigator, "standalone", { configurable: true, get: /* @__PURE__ */ __name(() => mode === "standalone", "get") });
2906
2907
  }
2907
2908
  }