Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Dec 2022 20:42:43 -0500
From:      Aryeh Friedman <aryeh.friedman@gmail.com>
To:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Slight OT: Making Firefox behave the same on FreeBSD and windows
Message-ID:  <CAGBxaXmiD-AAg5sNhT7pRi5wYeJk15W9xzV3k2mj0pLPPPbhyQ@mail.gmail.com>
In-Reply-To: <20221224112249N@bob.proulx.com>
References:  <CAGBxaXkaVUMvoAqWW3P_N5%2BShB32g2v45PuuGKG7cmrjhON9BA@mail.gmail.com> <alpine.BSF.2.20.2212222228460.29820@tripel.monochrome.org> <CABObuOr-KcMX60xVRa4FVmCzZE7ZaR_k_C4k=gb34EB34jBGsg@mail.gmail.com> <20221223120153244758626@bob.proulx.com> <CAN6yY1tULz2-rwZfnpCw%2B0vSC74YDp3b5G1_TkV8jK4uceaNMQ@mail.gmail.com> <20221224112249N@bob.proulx.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGBxaXmiD-AAg5sNhT7pRi5wYeJk15W9xzV3k2mj0pLPPPbhyQ>