INNER CODE UNIT · JavaScript
forceInstantScroll
sebastiancarlos/beachpatrol · commands/smoke-test.js:6
const forceInstantScroll = async (page) => {
await page.addStyleTag({
content: "html { scroll-behavior: initial !important; }",
});
};
// Every beachpatrol command must export a default async function which takes:
// - An object with { context, activePage } as its first argument, and
// - the arguments to the command.
//
// Then, you simply automate the browser by interacting with the BrowserContext API.
// - Docs: https://playwright.dev/docs/api/class-browsercontext
//
// The function returned can also be a "generator function" (or anything returning
// an iterator or an async iterator), as is the case here. Each yield is relayed
// to the client as one output line.
export default async function* ({ context, activePage }, ...args) {
const page = await context.newPage();