Closed Bug 666303 Opened 8 years ago Closed 7 years ago

Seamonkey 2.1 and newer are detected as Firefox 2.1 and newer on the Add-on Site

Categories

(addons.mozilla.org Graveyard :: Public Pages, defect, major)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
2012-10-25

People

(Reporter: Glutton.Vidal, Assigned: robhudson)

References

Details

User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20110608 Firefox/4.0.1 SeaMonkey/2.1
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20110608 Firefox/4.0.1 SeaMonkey/2.1

I would like to install
https://addons.mozilla.org/de/firefox/addon/stealthy/
But it doesn't work to install, because Seamonkey 2.1 is detected as Firefox 2.1, although the Build 4.0.1 should be compatible. Is it possible to change that, that the addon site detect the build in the same way like here.

Reproducible: Always
The reason it doesn't install is that the extension's install.rdf does not include a <targetApplication> section for SeaMonkey: if it did, https://addons.mozilla.org/en-US/seamonkey/addon/stealthy/ would not redirect to a "Firefox" AMO page.

Since the addon is, so to speak, "not even conscious of SeaMonkey's existence", which "Firefox version" is seen in the current (SeaMonkey) browser by the Firefox AMO page is immaterial.

It is admittedly a little weird that browsing that page with SeaMonkey displays "Not available for Firefox 2.1", with the appname of the one and the version of the other.

Steps to reproduce consist of either (a) trying to access with an AMO page for an addon which is actually not compatible with SeaMonkey (e.g. the link earlier in this comment), in which case we are redirected to a "Firefox" AMO page, or (b) just accessing a "Firefox" AMO page (such as the one in comment #0) with SeaMonkey. In either case AMO "thinks" that we are using Firefox, but with a "Firefox version" equal to what is actually our SeaMonkey version.

One possible solution would be to replace the "Add to Firefox" link by a "Download" link, and maybe add "Not compatible with SeaMonkey" but without a version number, if it is found that we try to browse a Firefox AMO page by means of SeaMonkey.
Severity: normal → minor
Status: UNCONFIRMED → NEW
Component: General → Public Pages
Ever confirmed: true
OS: Windows XP → All
Product: SeaMonkey → addons.mozilla.org
QA Contact: general → web-ui
Hardware: x86 → All
See Bug 671085 for an Add-on which does have Seamonkey in the RDF, but still a.m.o reports it as "Firefox 2.2" and prevents installation. Installing locally from the xpi file works. So a.m.o. is wrong, but Gecko is right.
(In reply to comment #1)
> The reason it doesn't install is that the extension's install.rdf does not
> include a <targetApplication> section for SeaMonkey: if it did,
> https://addons.mozilla.org/en-US/seamonkey/addon/stealthy/ would not
> redirect to a "Firefox" AMO page.
> 
> Since the addon is, so to speak, "not even conscious of SeaMonkey's
> existence", which "Firefox version" is seen in the current (SeaMonkey)
> browser by the Firefox AMO page is immaterial.

Sounds like this isn't a bug. Thanks for the investigation!
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Well, if a user browses with SeaMonkey to https://addons.mozilla.org/en-US/seamonkey/addon/twitzer-twitter-more/ (maybe after seeing a link to it in a newspost or email and manually changing "firefox" to "seamonkey" in the URL) he will be redirected to https://addons.mozilla.org/en-US/firefox/addon/twitzer-twitter-more/ which will think that he is using a "Firefox" application with a version equal to his SeaMonkey version. However, that extension supports Firefox 1.5 to 6.0 so its AMO page will not reject any current version of SeaMonkey, and there will be a big green button. The fact that the button says "Add to Firefox" (and not "Add to SeaMonkey") may escape the moderately attentive user, who may then click it. If he does, the extension will download, and only after download has completed will the doorhanger's progress bar be replaced by the error message "<extension name> could not be installed because it is not compatible with SeaMonkey <version>".

Shouldn't AMO recognise that SeaMonkey 2.2 is not only not Firefox 2.2, but not Firefox at all?

For instance, if I browse to that same extension page with Konqueror, the big green button says "Download Now". In Opera the button also says "Download Now" but it is white (with grey text) rather than green (with white text). Shouldn't SeaMonkey be treated in one of these ways?
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
(In reply to comment #4)
> 
> For instance, if I browse to that same extension page with Konqueror, the
> big green button says "Download Now". In Opera the button also says
> "Download Now" but it is white (with grey text) rather than green (with
> white text). Shouldn't SeaMonkey be treated in one of these ways?

This is related to bug 616767
(In reply to comment #5)
> (In reply to comment #4)
> > 
> > For instance, if I browse to that same extension page with Konqueror, the
> > big green button says "Download Now". In Opera the button also says
> > "Download Now" but it is white (with grey text) rather than green (with
> > white text). Shouldn't SeaMonkey be treated in one of these ways?
> 
> This is related to bug 616767

Yet it is different. Bug 616767's problem is that the button says "Download Now", but clicking it does not download.

The problem described in comment #4 is that
(a) the app name and version and version are mismatched
(b) clicking "Add to <appname>" (not "Download Now") tries to add, but fails *after* a download (depending on supported version): If I browse with *SeaMonkey* 2.1 an add-on whose supported range includes *Firefox* 2.1, the button will be green and say something that starts with "Add to", but clicking that button will fail *after* the download. Yet SeaMonkey 2.1 is not related with Firefox 2.1 but Firefox 4.0, and anyway, AMO should never believe that "SeaMonkey is Firefox" regardless of versions.

If I click right on the "add to" link, then "Save target link as", download does happen, so bug 616767 comment #1 "one can't download for someone else" is not applicable in the present case.

As I already said, Konqueror and Opera, unlike SeaMonkey, are not "confused" with Firefox.
Bumping up impact as this does affect any SM user visiting the AMO pages.
Severity: minor → major
Status: REOPENED → NEW
Summary: Seamonkey 2.1 is detected as Firefox 2.1 on the Add-on Site → Seamonkey 2.1 and newer are detected as Firefox 2.1 and newer on the Add-on Site
Take a look on this, problem is in media\js\zamboni\browser.js (https://github.com/mozilla/zamboni/blob/master/media/js/zamboni/browser.js)
function BrowserUtils() {
...
            'seamonkey': /Mozilla.*(SeaMonkey|Iceape)\/([^\s]*).*$/,
according to my friend, who aware in regex, it should be replaced with
            'seamonkey': /Mozilla.*(Firefox){0,1}.*(SeaMonkey|Iceape)\/([^\s]*).*$/
Also, somebody familiar with js should look on part starting from line 22, maybe that part also need fix
The seamonkey regex is working. In the console I have this...

var ua = 'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20110608 Firefox/4.0.1 SeaMonkey/2.1';
var old_pattern = /Mozilla.*(SeaMonkey|Iceape)\/([^\s]*).*$/;
old_pattern.exec(ua);
["Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20110608 Firefox/4.0.1 SeaMonkey/2.1", "SeaMonkey", "2.1"]

The problems seems to be that both `z.browser.firefox` and `z.browser.seamonkey` are true. And we have a few Firefox specific checks that check for `z.browser.firefox` being true. Which may be why AMO thinks you have "Firefox 2.1".  (Note: `z.browserVersion` is 2.1 b/c in browser.js the seamonkey check comes after Firefox and overwrites the value of browserVersion.)

Given the above... I'm not sure exactly what the solution is.

We also do not have unit tests for browser.js at the moment. Hopefully any changes to browser.js would also come with tests.  :)
I've play a bit with browser.js file and simple html test page, and there are a couple of ways to resolve issue:
1) Move SeaMonkey pattern above Firefox. Easiest way, but relying on patterns positions is bad idea, I suppose.
2) Before return add one additional check, if both SeaMonkey and Firefox true, and if, set Firefox false, code:
    if (browser['firefox'] && browser['seamonkey'])
    	browser['firefox'] = false;
Also simple, don't see any disadvantages.
3) Modify Firefox pattern to not match SeaMonkey, I find a way to construct anti-SeaMonkey pattern, but failed to integrate it with FF one. Example:
/^((?!SeaMonkey|Iceape).)*$/
Most correct way, but need somebody more familiar with regex to make a fix.
-------------------------------------------------------------
For now, I propose to use second way to fix the issue, and if later someone came with better patch, then use it
Change for Firefox pattern to not match Seamonkey
'firefox' : /Mozilla.*(Firefox|Minefield|Namoroka|Shiretoko|GranParadiso|BonEcho|Iceweasel|Fennec|MozillaDeveloperPreview)(?!.*SeaMonkey|Iceape)\/([^\s]*).*$/,
#2 sounds like the cleanest way
It appears that disabling "Advertise Firefox compatibility" should provide a work-around.
(In reply to David E. Ross from comment #13)
> It appears that disabling "Advertise Firefox compatibility" should provide a
> work-around.

No it doesn't. AMO (on some pages and widgets) thinks I'm "Firefox 2.16a1" even with the following user-agent string:

Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/19.0 Firefox/19.0 SeaMonkey/2.16a1
Fixed in https://github.com/mozilla/zamboni/commit/022bf6a 

I verified on our -dev server the following:

* https://addons-dev.allizom.org/en-US/seamonkey/ hover cards for add-ons show "Add to SeaMonkey". For those that don't support the version (e.g. StumbleUpon), it says, "Not available for SeaMonkey 2.13.1"

* https://addons-dev.allizom.org/en-US/firefox/addon/twitzer-twitter-more/ is a Firefox only add-on. Using SeaMonkey it shows a "Download Now" button. And that same URL using Firefox has a "Add to Firefox" button.

* https://addons-dev.allizom.org/en-us/firefox/addon/stealthy/
  - Previously this showed a greyed out "Add to Firefox" button on SeaMonkey and underneath said, "Not Available for Firefox 2.13.1"
  - Now it shows a "Download Now" button and says, "Works with Firefox 7.0 - 16.*".

* https://addons-dev.allizom.org/en-US/seamonkey/addon/am-context/
  - There may be a bug here (and if so, I'd like to file a new bug for it better describing how it should or shouldn't work with default-to-compatible).
  - This shows a greyed out "Add to Seamonkey" button with "Not available for SeaMonkey 2.13.1" underneath and a (?) icon. Clicking either the button or the question mark icon says you should be using Firefox 10 or higher. My guess is we are missing default-to-compatible detection for Seamonkey since this add-on version (v0.3) says it supports SeaMonkey 2.1 to 2.11.* (and I'm testing on 2.13.1), so it appears we are still using the detected version of 2.13.1 and comparing it with the minimum version of Firefox that supports d2c (version 10) and we are not above that so d2c isn't enabled.

For the most part, that few lines of code cleans up a lot.

Thanks Phoenix for the suggestion in comment 10.
Status: NEW → RESOLVED
Closed: 8 years ago7 years ago
Resolution: --- → FIXED
Assignee: nobody → robhudson.mozbugs
Target Milestone: --- → 2012-10-25
Just out of curiosity, why not regex from comment 11?
(In reply to Phoenix from comment #16)
> Just out of curiosity, why not regex from comment 11?

You presented 3 options. Wil liked option 2 and it was also the least likely to break anything, so that's what I went with.

This is pushed, but there's an issue with our CDN returning the old javascript and not the new one. Hopefully we'll resolve that soon, if not on Thursday with our next push.
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.