Last modified: 2010-07-21 21:54:12 UTC
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 );
The file upload feature change:
The file path is no longer transmitted to the browser, only the base filename.
You might wanna read bug 12766 ... especially https://bugzilla.wikimedia.org/show_bug.cgi?id=12766#c4
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)...
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?).