Let user block scripts from changing window.location on onload or timer (disable automatic JavaScript redirection, lock on current page)




DOM: Core & HTML
14 years ago
3 years ago


(Reporter: Damian Yerrick, Unassigned)


(Blocks: 1 bug)


Firefox Tracking Flags

(Not tracked)




(1 attachment)



14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030917
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030917

Some web sites have JavaScript code that detects whether or not a page
appears in its proper frameset environment, but after a reorganization
of the site without corresponding changes to the code, the code actually
redirects to a non-existent (404) page.  This affects me often when I
read pages from dead sites using Google's cache.

Other web sites are subscription sites that are dumb enough to send the
entire article to the client (so that the article shows up in search engines)
but use JavaScript to redirect non-members to the "buy a subscription" page.

I'd like to see Mozilla let the user control whether or not scripts can
automatically change the location.

Reproducible: Always

Steps to Reproduce:
1. Open the test case URL
2. Follow one of the Experimental group links
3. Get redirected to the page marked as "Highway Robbery" in the Control group
4. Open Preferences > Advanced > Scripts & Plugins

Actual Results:  
Lack of a checkbox to block automatic JavaScript redirects.

Expected Results:  
Preferences should have given me a way to block automatic JavaScript redirects.

This is like bug 83265 except dealing with automatically triggered JavaScript
'document.location' changes instead of HTTP headers or <meta http-equiv />.

Comment 1

14 years ago
Created attachment 132114 [details]
Local copy of test case from pinocchio.jk0.org

The machine 'pinocchio.jk0.org' is a workstation that is powered off
during severe weather.	Here's a tarball of the test case.


14 years ago
OS: Windows 2000 → All
Hardware: PC → All


10 years ago
Assignee: general → nobody
QA Contact: ashshbhatt → general

Comment 2

8 years ago
Please get this one implemented! Firefox really needs this, and there appears to be no extension to do this. :(
Flags: blocking1.8.1.next?
Flags: blocking1.8.1.next?

Comment 3

6 years ago
What about the noscript extension? That would block more than just redirects.
Blocks: 685496

Comment 4

6 years ago
I second that! Browser must obey "warn me if page tries to redirect..." user preference. Currently it can be easily bypassed using JavaScript window.location.
I suggest a community to promote this bug.
You need to log in before you can comment on or make changes to this bug.