Pip is not installed, my Python3 version is 3.7.9, my Python 2 version is 2.7.17. Setuptools cannot be found (but are installed).
Workarounds for implementation would be helpful. If this all works fine and someone else can reproduce this, I’d like to write a guide on how to do this at some point.
What are you trying to do exactly?
If your goal is to switch UAs in the browser, there’s a couple of things you could do.
One is using privoxy (which comes with this old perl script).
Another is to edit the mozilla config.
Both can be automated via a cron or systemd timer script.
As for the requirements of that package, requests and pytz are available on openrepos, but coloredlogs is not, that you would have install or package yourself.
Looking at the code, it seems the magic is sending requests to
http://126.96.36.199/useragents/?format=json (hardcoded), and that IP address seems to be down, so this wouldn’t work even if the python script did.
If you are trying to fix issues with the browser on some specific site, please have a look at https://sailfishos.org/wiki/WorkingWithBrowser#Debugging_User-Agent_problems. And if you find a working UA for some specific site, please contribute it to the ua-update.json so that others can benefit as well!
So is there a way to bypass to a different URL and do a rewrite for this?
The whole goal is to try to get this thing integrated and running to forcably change the useragent during access to the most common useragent for X browser and to keep a backup if a remote host/list can’t be reached.
Privoxy has to be configured, going through that process slowly… If I can teach myself all of this and get good, I want to write an extensive guide on how to implement this.
Still unclear what your goal is…
Is it about fingerprinting, or sites breaking, or what?
Because forcibly altering the UA will achieve nothing really, except sites breaking even more …
About privoxy: there’s a lot in the readme but the basic steps are:
- enable and start systemd service
- configure browser to use the proxy
After that you can do other things.
Well, the goal is to prevent fingerprinting and to spoof as many things as possible…
Good luck with that project!
If you do go the privoxy route, there are some examples in the file
conf/sailfish.action on how to spoof user agent with this:
And the perl script linked above (which would have to be modified to work on harbour-privoxy) is supposed to generate a “random/configurable” UA string from a cron script and place it in a file of its own (lets say
/usr/share/harbour-privoxy/conf/random-ua.action). You would then add the line to
and privoxy will spoof the UA for you.
That all being said: while being able to do that is certainly fun, there is very little privacy to be gained from it. Browser fingerprinting uses various techniques, and the simple fact you are using a fringe device like the ones running SFOS will make you very identifiable no matter what you do.
And spooofing UAs will break sites, not to mention any additional filtering one might do.
But if you succeed in getting good scores on e.g. these two sites, please let us know: