I have this page of a government site and using the developer console. I want to remove the onload event attached to the body tag by entering this code in the console:
var script = document.createElement("script"); script.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; document.head.appendChild(script); //wait for jquery library to load setTimeout(function(){ $("body").unbind("onload"); $("body").get(0).onload = null; }, 3000);
But that does not work.
How to remove this handler from attached javascript code? Since I need to remove it using the JS code attachรฉ in the Google Chrome extension.
I have not tried this code in Google Chrome Extension yet. First, I want it to work using the developer console.
source share