effect-playwright
    Preparing search index...

    Function layer

    • Creates a layer that configures scoped browser acquisition.

      Details

      Providing this layer does not launch a browser eagerly. A browser is launched when the browser effect is evaluated inside a scope. The layer also provides the underlying Playwright.Playwright service.

      Example (Acquiring the browser directly)

      import { Effect } from "effect";
      import { PlaywrightSpawner, chromium } from "effect-playwright";

      const program = Effect.gen(function* () {
      const spawner = yield* PlaywrightSpawner.PlaywrightSpawner;
      const browser = yield* spawner.browser;
      const page = yield* browser.newPage();
      yield* page.setContent("<h1>Effect</h1>");
      }).pipe(
      Effect.scoped,
      Effect.provide(PlaywrightSpawner.layer(chromium)),
      );

      Parameters

      Returns Layer<PlaywrightSpawner.PlaywrightSpawner>

      0.1.0