Xetera / ghost-cursor

🖱️ Generate human-like mouse movements with puppeteer or on any 2D plane
MIT License
1.03k stars 120 forks source link

TypeError: elem.remoteObject is not a function #77

Closed Solo-it closed 1 year ago

Solo-it commented 1 year ago

const puppeteer = require('puppeteer'); const {path,createCursor} = require("ghost-cursor"); const url = process.argv[2];

async function run() { browser = await puppeteer.launch({ args: ['--disable-gpu', '--no-first-run', '--no-sandbox', '--no-zygote'], "dumpio": true, "devtools": false, "ignoreHTTPSErrors": true, });

const page = await browser.newPage();
const cursor = createCursor(page);
await cursor.move(selector)
await page.goto(url);
await page.screenshot({ path: 'screenshot.png' });
browser.close();

} run();

Here is Error Message

TypeError: elem.remoteObject is not a function
at Object.<anonymous> (/usr/app/node_modules/ghost-cursor/lib/spoof.js:458:61)
at step (/usr/app/node_modules/ghost-cursor/lib/spoof.js:44:23)
at Object.next (/usr/app/node_modules/ghost-cursor/lib/spoof.js:25:53)
at fulfilled (/usr/app/node_modules/ghost-cursor/lib/spoof.js:16:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Solo-it commented 1 year ago

https://stackoverflow.com/questions/73810881/ghost-cursor-error-elem-remoteobject-is-not-a-function-in-puppeteer

Niek commented 1 year ago

What version of ghost-cursor are you using? Because this was fixed in one of the recent releases.

Niek commented 1 year ago

Closing this issue - will re-open in case it's reproducible on the latest version.

crispycarrot commented 1 year ago

Able to reproduce the original issue on v1.1.16 running puppeteer-core, headful, MacOS. Working as expected on Debian 10.