Closed Bug 423885 Opened 16 years ago Closed 15 years ago

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

Categories

(Firefox :: Extension Compatibility, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: clemens.fuchslocher, Unassigned)

Details

Attachments

(6 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
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.

[0] http://www.mozilla.com/en-US/firefox/all-beta.html
[1] http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2007/02/2007-02-07-04-trunk/
[2] http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2007/02/2007-02-08-04-trunk/
[3] http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2007/02/2007-02-09-04-trunk/
[4] http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2008/03/2008-03-19-04-trunk/


Reproducible: Always

Steps to Reproduce:
1. Install RefreshBlocker-0.5pre1.xpi.
2. Extract testcase.zip.
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
Attached file testcase.zip
Attached image testcase-1.png
Attached image testcase-2.png
Attached image testcase-3.png
Attached image preferences.png
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.
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...
Clemens, you can overlay onRefreshAttempted in browser.js
It returns true/false whether a refresh attempt detected by the browser is allowed or not.
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:

http://www.vakuumverpackt.de/refreshblocker/

This version should also be available from the official add-on site in the next few days:

https://addons.mozilla.org/en-US/firefox/addon/992
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.