Disable page redirects using Greasemonkey

Posted by Tomer Cohen on Stack Overflow See other posts from Stack Overflow or by Tomer Cohen
Published on 2010-05-29T09:24:21Z Indexed on 2010/05/29 9:32 UTC
Read the original article Hit count: 239

Filed under:
|
|

A website I wish to tweak is using window.location in order to redirect specific users to a blocking page. That website is doing it in plain <script> tag, so it is impossible to bypass it by overriding the onload event using document.body.setAttribute('onload','');.

Is there another way to inject my code to the page without using Firefox extensions such as NoScript?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <script type="text/javascript">
    if (1)  window.location="http://example.net"
  </script>
</head>
<body></body>
</html>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about firefox