ghost-cursor icon indicating copy to clipboard operation
ghost-cursor copied to clipboard

[Playwright support] Uncaught TypeError: elem.remoteObject

Open electrumguy opened this issue 1 year ago • 3 comments

I am getting this error:

Uncaught TypeError TypeError: elem.remoteObject is not a function
    at <anonymous> (...\node_modules\ghost-cursor\lib\spoof.js:483:61)
    at step (...\node_modules\ghost-cursor\lib\spoof.js:44:23)
    at <anonymous> (...\node_modules\ghost-cursor\lib\spoof.js:25:53)
    at fulfilled (...\node_modules\ghost-cursor\lib\spoof.js:16:58)

Sample code to regenerate:

import { chromium } from 'playwright';
import { createCursor } from "ghost-cursor"

const example = (async () => {
        const browser = await chromium.launch({ headless: false });
        const page = await browser.newPage();
        const cursor = createCursor(page)
        await page.goto('https://www.example.com/')
        await cursor.click('body > div:nth-child(1) > p:nth-child(3) > a:nth-child(1)', { waitForClick: 10000, waitForSelector: 10000, paddingPercentage: 20 })
})();

Utilizing: "@playwright/browser-chromium": "^1.41.2" "ghost-cursor": "^1.2.0",

electrumguy avatar Feb 21 '24 11:02 electrumguy

As stated, ghost-cursor is a library for puppeteer and not for playwright. It should be possible to add playwright support though, feel free to open a PR.

Niek avatar May 08 '24 18:05 Niek

https://github.com/reaz1995/ghost-cursor-playwright

unickq avatar Sep 03 '24 09:09 unickq