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

RESOLVED FIXED

Status

()

Firefox
Extension Compatibility
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: Clemens Fuchslocher, Unassigned)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(6 attachments)

(Reporter)

Description

10 years ago
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
(Reporter)

Comment 1

10 years ago
Created attachment 310498 [details]
RefreshBlocker-0.5pre1.xpi
(Reporter)

Comment 2

10 years ago
Created attachment 310499 [details]
testcase.zip
(Reporter)

Comment 3

10 years ago
Created attachment 310500 [details]
testcase-1.png
(Reporter)

Comment 4

10 years ago
Created attachment 310501 [details]
testcase-2.png
(Reporter)

Comment 5

10 years ago
Created attachment 310502 [details]
testcase-3.png
(Reporter)

Comment 6

10 years ago
Created attachment 310503 [details]
preferences.png
(Reporter)

Comment 7

10 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.
(Reporter)

Updated

10 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

9 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.
(Reporter)

Comment 10

9 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:

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
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.