Re: Slight OT: Making Firefox behave the same on FreeBSD and windows

From: Aryeh Friedman <aryeh.friedman_at_gmail.com>
Date: Sun, 25 Dec 2022 01:42:43 UTC
Top quoting since my reply is not directly related to the actual body
of the message I am replying to.   Note more direct replies are
inline.

It seems like there are enough people with this issue that if we
complain collectively (petition?) to chase that they might fix the
problem on their end.    Now the question is this a framework issue
for them and if so who made the framework (i.e. so other sites work
also) and we should complain to them.

Correctly parsing user agent is f**king trivial for example here is
some Java I wrote for a video project to detect browser/OS combos (for
some whacked out reason Quicktime/MOV can't be played in Safari on a
iPhone [works on a Mac] in any mode beyond a full download before play
starts):

// src/java/org/petitecloud/pcutil/web/video/OsGui.java

package org.petitecloud.pcutil.web.video;

import java.util.Collections;
import java.util.List;

import org.petitecloud.util.ArrayUtil;

/**
 * Enum constants representing operating systems (and their GUIs)
 *
 * Copyright (C) 2022 Friedman-Nixon-Wong Enterprises, LLC & contributors
 *
 * @author dnixon
 * @version Sat Jul  2 03:05:20 EDT 2022
 */
public enum OsGui implements UserAgentItem
{
    ANDROID(new String[] {"android"}, new String[] {}, true)
    {
        @Override
        public boolean usesAjax(Browser b)
        {
            return b==Browser.CHROME;
        }
    },
    IPHONE(new String[] {"iphone"}, new String[] {}, true)
    {
        @Override
        public boolean allowsChunking(Browser b)
        {
            return true;
        }
    },
    MAC(new String[] {"mac os"},
            new String[] {"iphone"},
            false)
    {
    },
    XORG(new String[] {"linux", "freebsd"},
            new String[] {"android"},
            false)
    {
    },
    WINDOWS(new String[] {"windows"}, new String[] {}, false)
    {
        @Override
        public final boolean allowsChunking(Browser b)
        {
            if ( Browser.EDGE == b )
                return false;

            return super.allowsChunking(b);
        }  // END method allowsChunking
    };

    ....
}  // END *** enum OsGui

public enum Browser implements UserAgentItem
{
    CHROME(new String[] {"chrome", "crios"}, new String[] {"edg"})
    {
        @Override
        public boolean delayPrelimVideoSrcAssignment(OsGui gui)
        {
            return gui==OsGui.ANDROID;
        }
    },  // END *** CHROME
    EDGE(new String[] {"edg"}, new String[] {})
    {
        @Override
        public final boolean needsDirectLinkAsJSAssignment(
                                                     OsGui osGui)
        {
            return true;
        }  // END *** method needsDirectLinkAsJSAssignment
    },  // END *** EDGE
    FIREFOX(new String[] {"firefox", "fxios"}, new String[] {})
    {
    },  // END *** FIREFOX
    SAFARI(new String[] {"safari"},
            new String[] {"chrome", "edg", "crios", "fxios"})
    {
        @Override
        public final boolean allowsLinkTagParamFetch(OsGui osGui)
        {
            return osGui == OsGui.MAC;
        }  // END *** method allowsLinkTagPAramFetch
    };  // END *** SAFARI

   ...
}  // END *** enum Browser



On Sat, Dec 24, 2022 at 2:41 PM Bob Proulx <bob@proulx.com> wrote:
>
> Kevin Oberman wrote:
> > Bob Proulx wrote:
> > > parv/FreeBSD wrote:
> > > > Chris Hill wrote:
> > > > > I had the same issue with a Chase account. It seems that they object to
> > > > > seeing "FreeBSD" in the user agent string. I used one of the many
> > > > > plug-ins to change the string for that site, so my machine would appear
> > > > > to be running Linux. It works well.
>
> This is definitely our client side workaround to this problem.  The
> next thing would be to complain to sites that UserAgent is not
> something that should be used for security blockage!  It's not actual
> security.  It's simply annoying.

The only reason for even detecting browser/OS combos is to handle any
local oddballness.   This goes along with the attitude many "modern"
developers have of "linux==UNIX and [all other unix's]!=UNIX".   I
have seen it go so far as some online games (e.g. forge of empires)
turn off graphics acceleration if they don't recognize the OS thus
making the game unplayable (5 to 10 load times and 30 sec to 1 min
response times).

-- 
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org