LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   useragent on Seamonkey browser for Slackware logo on LQ (https://www.linuxquestions.org/questions/slackware-14/useragent-on-seamonkey-browser-for-slackware-logo-on-lq-4175591720/)

SCerovec 10-19-2016 05:16 AM

useragent on Seamonkey browser for Slackware logo on LQ
 
I've searched and only found matching but obsolete and closed threads.

this topic is solved (will mark it so ASAP)
this thread can also be closed as well.

It's only merely for reference.

HOWTO change the reported browser agent to reflect Slackware GNU/Linux.
Convenient here on LQ and on distrowatch :)


tested on Seamonkey 2.40 and Firefox v45.0

go to here first: online user agent checker

copy and paste Your own current user agent string, have it handy (gvim comes to mind)

navigate to
Code:

about:config
input on the filter
Code:

useragent
to reduce the list a bit

right click and select new->string
input:
Code:

general.useragent.override
then it asks for the string, copy and paste Your original string (you saved it didn't you?)
mine was:
Code:

Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
for firefox
then edit it to something like this:
Code:

Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Slackware64/14.2
NOTE:
Having the appropriate correct user agent and a updated browser is a security measure.
Having an wrong user agent can lead to security issues, bot positive and negative.
You have been warned.

Enjoy Slackware logo on our posts :)

drgibbon 10-19-2016 06:40 AM

Sweet, I was wondering how that Slackware logo got there :hattip:

drgibbon 10-19-2016 07:07 AM

You could also use an addon like Custom UserAgent String to set the user-agent on a per-site basis.

SCerovec 10-19-2016 08:25 AM

Okay, all go edit useragent now and go hit distrowatch.com :^)

af7567 10-19-2016 08:31 AM

I just installed the user agent switcher firefox extension to add the Slackware part (because I wasn't sure what the default useragent was meant to be :) ). I am wondering what will happen when firefox is updated though? I guess I would need to change the user agent manually after each firefox upgrade.

drgibbon 10-19-2016 09:01 AM

Quote:

Originally Posted by af7567 (Post 5620010)
I just installed the user agent switcher firefox extension to add the Slackware part (because I wasn't sure what the default useragent was meant to be :) ). I am wondering what will happen when firefox is updated though? I guess I would need to change the user agent manually after each firefox upgrade.

Yeah I noticed that, the version numbers appear to be static parts of the string. Although I changed it for linuxquestions.org only (since I just like the Slackware icon on the posts), so I can live with the user-agent string being out of date for one site only :) There may be better addons though.

SCerovec 10-19-2016 01:10 PM

Or, "roll Your own" as we Slackers do ;)

bassmadrigal 10-20-2016 08:45 AM

Quote:

Originally Posted by SCerovec (Post 5620008)
Okay, all go edit useragent now and go hit distrowatch.com :^)

I know this was kinda tongue in cheek, but distrowatch tracks hits on the individual distro pages, not the useragent of the browsers visiting the site. So changing your useragent won't affect Slackware's rankings.

Quote:

[The statistics] simply show the number of times a distribution page on DistroWatch.com was accessed each day, nothing more.

SOURCE: http://distrowatch.com/dwres.php?resource=popularity

SCerovec 10-20-2016 12:16 PM

I see, then we need dial Slackware into our speed dial plugin?
O.o

SCerovec 11-07-2016 10:12 AM

I frequently visit this thread lately
;)

tronayne 11-08-2016 07:32 AM

There is another way to skin this cat.

Both Firefox and SeaMonkey recognize and will use a file, user.js, in .mozilla/firefox/*.default directory for Firefox and .mozilla/seamonkey/*.default directory for SeaMonkey.

For Firefox ESR 45.4.0 (the stable version in Slackware) user.js looks like this:
Code:

cat user.js
user_pref("general.useragent.override", "Mozilla/5.0 (X11; Slackware Linux x86_64; rv:45.4) Gecko/20100101 Firefox/45.4");

When there is a version change, click Help then About Firefox to see the version number and simply change the values in user.js (there are two).

The same file for SeaMonkey looks like this:
Code:

cat user.js
user_pref("general.useragent.override", "Mozilla/5.0 (X11; Slackware Linux x86_64; rv:2.40) Gecko/20100101 SeaMonkey/2.40");

Those files do not vanish when you install an update but you do need to manually edit the version number.

I would be nice if Slackware embedded the string in the package, but that would violate the unfooled-areound-with rule (like "branding") but that ain't gonna happen methinks.

This is the easiest way I've found to get the logo to appear in LQ.

Hope this helps some.

slalik 11-08-2016 08:36 AM

Quote:

Originally Posted by tronayne (Post 5628322)
Those files do not vanish when you install an update but you do need to manually edit the version number.

So, it's easier to put version 45.0 instead of 45.4. Firefox 45.4.0esr has the following useragent string:
Code:

Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
This way changing of this string will be need only when the major version changes.

SCerovec 11-08-2016 09:52 AM

Interesting thing would be to extract this string from said browser? :scratch:
therefrom it would be next to trivial to forge the new one accordingly

Ztcoracat 11-24-2016 10:36 PM

Thanks for the instructions.

slalik 11-25-2016 07:42 AM

Quote:

Originally Posted by SCerovec (Post 5628376)
Interesting thing would be to extract this string from said browser? :scratch:
therefrom it would be next to trivial to forge the new one accordingly

Documentation https://developer.mozilla.org/en-US/...-Agent/Firefox claims that number "20100101" is fixed for a Desktop browser, so the string is defined by the version of the browser. For example:
Code:

useragent=$(ls /var/log/packages/|grep -o "mozilla-firefox-[[:digit:]]*")
useragent="${useragent#mozilla-firefox-}.0"
useragent="Mozilla/5.0 (X11; Slackware Linux x86_64;; rv:$useragent) Gecko/20100101 Firefox/$useragent"



All times are GMT -5. The time now is 06:31 AM.