Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
Uncaught TypeError: Failed to construct 'MouseEvent': Failed to read the 'view' property from 'UIEventInit': Failed to convert value to 'Window'

I can run the following in the Chrome console and it does what I want without error:

document.querySelector('.flat.pagination.next').dispatchEvent(new MouseEvent("mousedown",{ view: window, bubbles: true, cancelable: true, clientX: 0, clientY: 0, button: 0 }));

However, if I put the same line of code in to a Tampermonkey script, I get the following error:

Uncaught TypeError: Failed to construct 'MouseEvent': Failed to read the 'view' property from 'UIEventInit': Failed to convert value to 'Window'.

Presumably there is something wrong with the view: window part, but I can't see why it would behave differently in the console to a script.

Any ideas how I can get it to work?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I was able to get it to work as I needed by removing the options:

document.querySelector('.flat.pagination.next').dispatchEvent(new MouseEvent('mousedown'));
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!