Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/documentpip/tests/browser/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  head.js

  Sprache: JAVA
 

/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */


async function newTabWithPiP(requestOptions = {}) {
  // Create a tab that can use the API (secure context)
  const tab = await BrowserTestUtils.openNewForegroundTab({
    gBrowser,
    opening: "https://example.com",
    waitForLoad: true,
  });
  const browser = tab.linkedBrowser;

  // Open a document PiP window
  const chromePiPPromise = BrowserTestUtils.waitForNewWindow();
  await SpecialPowers.spawn(browser, [requestOptions], async options => {
    content.document.notifyUserGestureActivation();
    await content.documentPictureInPicture.requestWindow(options);
  });
  const chromePiP = await chromePiPPromise;

  return [tab, chromePiP];
}

// Move pip and wait till content was notified
async function movePiP(chromePiP, { x, y }) {
  const browser = chromePiP.gBrowser.selectedBrowser;

  // Store a promise in content for when it was notified of this move
  await SpecialPowers.spawn(browser, [x, y], async (_x, _y) => {
    const obs = SpecialPowers.Services.obs;
    const topic = "docshell-position-size-changed";
    content.__observerPromise = new Promise(resolve => {
      function notify() {
        if (content.screenX == _x && content.screenY == _y) {
          obs.removeObserver(notify, topic);
          resolve();
        }
      }
      obs.addObserver(notify, topic);
    });
  });

  chromePiP.moveTo(x, y);

  // Wait for the previously created promise
  await SpecialPowers.spawn(browser, [], async () => {
    await content.__observerPromise;
    delete content.__observerPromise;
  });
}

Messung V0.5 in Prozent
C=73 H=100 G=87

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.