Page MenuHomePhabricator

Create is_ff3 in wikibits.js
Closed, DeclinedPublic

Description

Please create an "is_ff3" variable in wikibits.js that detects FireFox 3 and up, just like "is_ff2" detects versions 2 and up. This version of FireFox contains a significant change in its "file upload" feature that breaks several of our homegrown extensions, so it would be very helpful to detect the browser version.

We could do this ourselves but I believe it would be helpful to others to have it in core code, since it's so simple. Thank you.

I imagine it would be simply:

var is_ff3 = /firefox\/[3-9]|minefield\/3/.test( clientPC );


Version: 1.14.x
Severity: enhancement

Details

Reference
bz16125

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:21 PM
bzimport set Reference to bz16125.
bzimport added a subscriber: Unknown Object (MLST).

The file upload feature change:

http://ubuntuforums.org/archive/index.php/t-929711.html

The file path is no longer transmitted to the browser, only the base filename.

The choice of implementation doesn't matter (to me), whether the functionality is in a variable, function, etc. As long as MediaWiki provides some way to detect the browser and version in use. This "file upload" change is pretty significant.

You should test the bug/change, not browser version. Is that possible here?

Interesting idea, but in this case, I don't think it can be done in a friendly manner. The feature (<input type="file">) is available in all browsers; only FF3 considers it a security risk to return the full file path (which we need). You could check the results AFTER the user has spent the time navigating to a file and selecting it, and then say, "Sorry, that file you just spent time selecting, you can't use it." But that's nasty to the user.

Fwiw: an is_ff3 is adding more hacky variables that shouldn't be :)

I'd suggest a nice framework that allows us to detect browser versions more easily. Then things like isBrowser( 'ie6' ) or 'ff3' could be tested and accounted for. I know these things are always less-than-ideal. Just wanted to throw the idea out.

I don't see the need of a is_ff3 to check if you will get a full path or not. You should look if it has a folder name or not.
Other browsers also do the same, even IE, which uses a fake path, which will be the reaction from every browser in the future (html5)...

ayg wrote:

The current array of variables is obnoxious and should die, fully agree with not adding more. I think jQuery will do this for you anyway, once that's always available by default (is it yet?).

maiden_taiwan changed the task status from Invalid to Declined.Dec 21 2014, 7:15 PM
maiden_taiwan claimed this task.

I originally filed this 4+ years ago, it was asking for a hack, and the file wikibits.js doesn't even existing anymore. This should not be done.