The handling of the allowMetaRedirects attribute in the nsIDocShell interface seems to be broken.




11 years ago
10 years ago


(Reporter: clemens.fuchslocher, Unassigned)



Firefox Tracking Flags

(Not tracked)



(6 attachments)



11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20080201 Firefox/
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5pre) Gecko/2008031904 Minefield/3.0b5pre

The extension RefreshBlocker isn't able anymore to allow or deny the execution of a META refresh element by setting the allowMetaRedirects attribute of the corresponding nsIDocShell. It works fine with Firefox 1.0, 1.5 and 2.0. But it is broken with official beta builds of Firefox 3.0 from [0].

It stopped working with the nightly build 2007-02-09-04-trunk[3]. The builds 2007-02-07-04-trunk[1] and 2007-02-08-04-trunk[2] are OK. It is also not working with the current build 2008-03-19-04-trunk[4].

This could relate to bug 83265.


Reproducible: Always

Steps to Reproduce:
1. Install RefreshBlocker-0.5pre1.xpi.
2. Extract
3. Open testcase/testcase.html.
4. No refresh is executed. That's OK. See testcase-1.png.
5. Go to the preferences of RefreshBlocker and add the regular expressions ^.*1\.html and ^.*2\.html to the whitelist.
6. See preferences.png.
7. Open testcase/testcase.html again.
8. No refresh is executed. That's not OK. 1.html and 2.html should be get refreshed after 5 and 10 seconds. See testcase-2.png.
9. Compare this with the behaviour of Firefox 2.0 or the nightly build from 2007-02-08-04-trunk. See testcase-3.png.

The relevant method is called allowMetaRedirectsForThisDocument. This method is located in the file RefreshBlocker.js.

$ unzip RefreshBlocker-0.5pre1.xpi
$ cd chrome
$ unzip RefreshBlocker.jar
$ less content/RefreshBlocker.js

Comment 1

11 years ago

Comment 2

11 years ago
Posted file

Comment 3

11 years ago
Posted image testcase-1.png

Comment 4

11 years ago
Posted image testcase-2.png

Comment 5

11 years ago
Posted image testcase-3.png

Comment 6

11 years ago
Posted image preferences.png

Comment 7

11 years ago
The new option "Warn me when web sites try to redirect or reload the page" in Firefox 3.0 could replace the need of the RefreshBlocker extension. But this new feature is broken in situations where RefreshBlocker has worked since Firefox 1.0. See bug 424167.


11 years ago
OS: Linux → All
Version: unspecified → Trunk
(In reply to comment #7)

That new option doesn't show exactly to which page the redirect was denied and offers only laconic possibility to allow the redirect leaving it's details unknown to the user.

Therefore it doesn't fully qualify as a replacement to functionality provided so far by RefreshBlocker add-on (thanks for your good work, Clemens!)

Hopefully the Bug gets fixed soonish and all users who want to have more control on their browsing actions can enjoy both Firefox 3 and RefreshBlocker add-on!

Going to downgrade to Firefox 2 so far...

Comment 9

10 years ago
Clemens, you can overlay onRefreshAttempted in browser.js
It returns true/false whether a refresh attempt detected by the browser is allowed or not.

Comment 10

10 years ago
Hello Thomas,

Thank you for your suggestion. It works great and solved the problem. 

I have created a new version of RefreshBlocker. It can be found here:

This version should also be available from the official add-on site in the next few days:
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.