Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

1.4 KB
Raw Blame
<!doctype html>
<html>
<body>
  <script>
    const screenObj = window.screen;
    const orientation = screenObj.orientation;

    let screenCount = 0;
    let orientationCount = 0;
    let onchangeCount = 0;

    const screenListener = () => {
      screenCount += 1;
    };
    const orientationListener = (event) => {
      if (event.type === "change") {
        orientationCount += 1;
        event.preventDefault();
      }
    };

    orientation.onchange = () => {
      onchangeCount += 1;
    };

    screenObj.addEventListener("change", screenListener);
    orientation.addEventListener("change", orientationListener);

    const screenDispatch = screenObj.dispatchEvent(new Event("change"));
    const firstOrientationDispatch = orientation.dispatchEvent(
      new Event("change", { cancelable: true })
    );

    screenObj.removeEventListener("change", screenListener);
    orientation.removeEventListener("change", orientationListener);

    const secondOrientationDispatch = orientation.dispatchEvent(new Event("change"));

    window.screenEventListenerCount = screenCount;
    window.screenDispatchReturn = screenDispatch;
    window.screenOrientationListenerCount = orientationCount;
    window.screenOrientationOnchangeCount = onchangeCount;
    window.screenOrientationFirstDispatchReturn = firstOrientationDispatch;
    window.screenOrientationSecondDispatchReturn = secondOrientationDispatch;
  </script>
</body>
</html>