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

73
Views
Edit Javascript of a website before the page is loaded Chrome Extension

I am trying to make a chrome extension that can edit and remove parts of Javascript of a webpage preferably before the page is loaded.

For Example, the following script tag is within my test html website.

<script>
document.addEventListener("visibilitychange", onchange);
function onchange(){
    console.log('left');
}
</script>

This code tells the console when the user switches tabs. I would like to be able to edit this specific code only to prevent this from happening. Can I modify the text of JavaScript before runtime?

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

0

You cant modify the code before runtime but you can remove the event listener.

removeEventListener("visibilitychange", onchange);

Note: You technically can edit JS before it's executed in Chrome using LocalOverrides however it requires you to have your devtools open on page load.

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!