Showing posts with label Firefox. Show all posts
Showing posts with label Firefox. Show all posts

2022-05-02

Firefox Focus - weird but good, standalone mobile browser and ad blocker

The best ad blocker around (uBlock Origin [0]) is not available on iPhone iOS.  That's essentially because Firefox and other browsers on iOS do not have the ability to load plugins as sophisticated as uBlock Origin.

A good substitute is Firefox Focus [1].  It's a content blocker on iOS, and can be set up that way so that Focus will block ads from showing when you use Safari!

A weird thing though is that Focus will not block ads on the main Firefox browser.  Again, something to do with iOS restrictions on iPhones.

That's ok, because Firefox has ad blocking built in (though as an obscure feature).

Another weird thing is that Firefox Focus also functions as a weird mobile web browser.  Weird because although Focus is "Firefox" branded, it doesn't have any of the account and password syncing features of the actual Firefox browser.

Oh, and Focus doesn't have tabs.  You literally have to focus on one web page at a time.

 

[0] https://github.com/gorhill/uBlock

[1] https://en.wikipedia.org/wiki/Firefox_Focus


2022-04-25

Ad blocking in Firefox on iPhone iOS

uBlock Origin [0] is a plugin for the best ad blocking available, and it's available for Firefox on Android, Windows, Mac, and Linux.

However, Firefox on iPhone iOS (FF-iOS) does not have any plug-in support, so uBlock Origin is not available for it.

FF-iOS doesn't support plug-ins apparently because it's actually using Safari's rendering engine underneath (a choice forced by Apple, apparently).

What to do about ad blocking in FF-iOS then?

Turns out FF-iOS has ad blocking built-in! You just need to go into "Settings" > "Tracking Protection". Then enable "Enhanced Tracking Protection", and set "Protection Level" to "Strict".

This feature is frustratingly [1][2] not well publicized [3]!

Another very popular plug-in is "dark mode", and that too is built into FF-iOS! It's very prominently publicized in the app's "more" menu though.

[0] https://github.com/gorhill/uBlock
[1] https://www.reddit.com/r/firefox/comments/jwi1r9/firefox_ios_should_integrate_with_ublock_to_make/
[2] https://www.reddit.com/r/firefox/comments/n9jfui/firefox_ios_and_lack_of_content_blockers/
[3] https://github.com/mozilla-mobile/firefox-ios/issues/5198#issuecomment-575617840

2021-03-25

Use ISO 8601 dates in PCManFM on Debian LXQt

I like ISO 8601 or RFC 3339 style dates.  That is, rather than "January 15, 2021", I like "2021-01-15".

This is especially useful in a file manager, having all the year-month-day lined up vertically in a column.

I also prefer 24-hr time format for the same reason.  But how to set this up?

 

macOS Finder

For Mac's file manager, it's really easy to set the date/time format:

Just open System Preferences > Language & Region > Advanced > Dates, then modify the date formats to whatever you want.  At the same time, you could go to the Times tab and set it to use 24-hr format. 

Done!  I offer this as just a point of comparison for what's below...


Debian LXQt PCManFM

On LXQt's PCManFM file manager, running on Debian, the setup was... annoyingly difficult.

PCManFM does not allow custom date/time formatting.  It only respects the system set locale.  So you have to choose the right locale.

Step 1.1: Select Locale

On LXQt, you can easily set the locale (they call it "Region") by running lxqt-config-locale in the terminal, or else click the system Preferences > LXQt settings > Locale.

Step 1.2: Which locale to choose???

You have a number of options.

Do you want:

  • English language
  • dollar denominated
  • metric
  • ISO-8601
  • but 12-hr time?

Use Canadian English (en_CA) locale.

If that's not close enough, and you really want 24-hr time as well, you can enable Detailed Settings and change the Time locale to Sweden - English (en_SE).

Be sure to see Step 2: Installing Locales in Debian, because chances are doing the above will cause system errors later!

Note that en_CA uses Canadian dollars, not USD!  You can change the Currency locale to American English (en_US) if you want real USD dollars.  Although it probably doesn't matter for formatting purposes.

Why Sweden?  It turns out lots of Europeans want something similar, as in a locale that is English language, metric, using ISO-8601 or similar style dates!

Sweden - English is an unofficial locale made up to give us that [1], but it does use Swedish kronor SEK for currency [2].  That's why you only want to set the Time locale to use en_SE, keeping the rest as en_CA (or en_US).

 

Step 2: Installing Locales in Debian

Selecting the "Region" in LXQt's locale preference app is just half the story.

PCManFM will probably work fine as is.  Qt apps are fine because it uses it's own Qt locale definition lookup system, and includes en_CA and en_SE by default.

Debian does not include en_CA by default, so you'll have to install it.  And it does not have en_SE... not at all... you'll have to add the en_SE definition file manually then install it.

You can download a copy of the en_SE locale definition written by Mikael Auno [7].  Then create this directory if it doesn't exist:

/usr/local/share/i18n/locales

Place the en_SE file into the above locales directory.  Create a text file in the above i18n directory containing this text:

en_SE.UTF-8 UTF-8

Then run in terminal:

$ sudo dpkg-reconfigure locales

You should see a list of locales you can install.  Look for and install the ones you selected in LXQt's locale preference app.  For my example above, that means en_CA, en_US, and en_SE.

Lastly, logout and re-login for the changes to take effect.

 

Fully Custom Locales in Debian: don't bother

From above, you see Debian allows you to create totally custom locales, so you can customize all the formats the way Macs can!  After all, that en_SE locale file you downloaded was just made up so to speak, and you can customize it however you want.

...but Qt won't use it.  Qt's locale system runs parallel to Debian Linux's.

So why go through the trouble of installing the en_SE locale if Qt won't use it?  Because if you don't, you'll run into problems with non-Qt apps, problems like:

Run locale in the terminal, and it'll complain:

locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Unzip certain archives using file-roller results in a dialog box complaining:

An error occurred while extracting files.
Pathname can't be converted from UTF-8 to current locale.

That occurs because a locale you chose in LXQt was not installed in Debian [8].  Qt is perfectly happy though, as it runs a separate locale system...

 

Firefox locale incompatibility

If you set your locale to Canadian or US English (en_CA or en_US), and enabled Detailed Settings to change the Time locale to Sweden - English (en_SE), Firefox will show numbers in Swedish / European style, like "3,14" instead of "3.14".

This problem happens at least in the downloads window.

Method 1: Fix by setting LC_ALL environment variable

The most reliable way to fix it in Debian is to set the LC_ALL environment variable, but only for Firefox [13].  Don't set LC_ALL globally or it'll undo the locale changes above, plus you just shouldn't as it overrides everything [12]. 

For the terminal :

With that said, all it involves is opening Firefox in the terminal like this:

LC_ALL=en_CA.utf8 firefox

You can save that in a script that's in your PATH so running Firefox always uses the LC_ALL locale.

For the Firefox icon:

The Firefox icon in Debian requires a different fix though.  That icon in the applications menu is controlled by a  firefox.desktop file located at:

/usr/share/applications/firefox.desktop  

You can modify it directly or, safer, copy it to your user's applications folder:

~/.local/share/applications

Once copied, open it in a plaintext editor and change the Exec line to this:

Exec=sh -c "LC_ALL=en_CA.utf8 /usr/bin/firefox"

 

Method 2: Fix by setting Firefox locale internally

The "official" way to set the Firefox user interface locale is via Firefox's preferences [14]:  open preferences, then go to the Language section of the General panel.

I've tried it on Debian and it doesn't work.

You could also try finding in about:config the intl.locale.requested key and set it to the desired locale [15].  I didn't test this method though because setting the LC_ALL environment variable worked perfectly for me.


Other locale options

Sweden - English (en_SE) is an unofficial locale made up to give us English language, metric, ISO-8601 date format [1].  But it uses Swedish kronor SEK for currency [2].

Denmark - English (en_DK) is another unofficial locale made up with similar English and metric formats [3].  But the date is backwards (in dd/MM/y format), and uses Danish kroner DKK currency [4].

Ireland - English (en_IE) is an official locale that, like Denmark - English, gives us English and metric units [5], and like en_DK, the date is backwards (in dd/MM/y format).  It uses Euro for currency [6] though.

So by mixing and matching Ireland, Denmark, and Sweden, you should be able to get a reasonable ISO 8601/English/Euro(pean) locale.

And mixing Canada, US, and Sweden will get you a reasonable ISO 8601/English/Dollar locale.


References

[1]: https://unix.stackexchange.com/a/62318

[2]: https://icu4c-demos.unicode.org/icu-bin/locexp?d_=en&_=en_SE

[3]: https://unix.stackexchange.com/a/272665 and https://superuser.com/a/1269909

[4]: https://icu4c-demos.unicode.org/icu-bin/locexp?d_=en&_=en_DK

[5]: https://unix.stackexchange.com/a/62317

[6]: https://icu4c-demos.unicode.org/icu-bin/locexp?d_=en&_=en_IE

[7]: https://bugs.launchpad.net/ubuntu/+source/langpack-locales/+bug/208548/comments/11

[8]: https://unix.stackexchange.com/a/269293

[12]: https://wiki.debian.org/Locale#Configuration 

[13]: https://unix.stackexchange.com/questions/34965/how-to-change-firefox-language#comment47453_34967

[14]: https://support.mozilla.org/en-US/kb/use-firefox-another-language?redirectslug=use-firefox-interface-other-languages-language-pack&redirectlocale=en-US#w_how-to-change-the-language-of-the-user-interface

[15]: https://support.mozilla.org/en-US/questions/1223719#answer-1127761


Bibliography

[9]: https://github.com/lxqt/pcmanfm-qt/issues/656

[10]: https://github.com/lxqt/lxqt-config/issues/507

[11]: https://wiki.debian.org/Locale


2013-08-07

Firefox 23 removed Advanced JavaScript Settings: how to get them back

The all new Firefox 23.0 removed a bunch of old features, including the blink tag. Most people won't care, because they are old features or, by now, reserved only for really advanced users. Things like the Advanced JavaScript Settings were removed along with the ability to disable JavaScript in general.

It makes sense given that nowadays, JavaScript is a given for basically all web apps. But strangely the Advanced JavaScript Settings features were removed from the Preferences window, which I liked using to fine-tune what I want disabled (because the vast majority of JavaScript is fine with me).

Specifically, there were five options. For now, the features are still there, but hidden in the about:config options screen (type "about:config" as the URL to see it).  Here are the about:config equivalent of the now hidden Advanced JavaScript Settings:
 Enjoy the new Firefox!

2013-07-11

Firefox lost my saved tabs due to hidden user Library Preference folder on Mac OS X 10.6.8

The symptom is odd enough.  You let Firefox upgrade itself, and upon reopening, you lose all your saved tabs and bookmarks.  Is it Firefox screwing up and losing all your saved tabs after an upgrade?  Or is it because you're on Mac OS X 10.6.8 with an encrypted home folder?

For reasons I know not, Mac OS X can split your home Library folder into two pieces (on Mac OS X 10.6.8 with an encrypted home folder).  Supposing your username is hsimpson, then one of your Library folders (the usual one) is inside the encrypted home folder, in the usual ~/Library.  The other one is in /Users/.hsimpson.

Best way to tell if Firefox is using the wrong Library folder is to open the Firefox profile manager.  Go to the Terminal, and type in something like:

/Applications/Firefox.app/Contents/MacOS/firefox-bin --profilemanager

Of course, firefox-bin is the actual executable on a Mac, hidden inside the Firefox.app application bundle (really just a special folder).  With the profile manager open, hovering the mouse over a profile name will display the directory path to where the profile is stored.

You may have to do some experimentation to figure out which is the "true" profile folder with the most up to date tabs and bookmarks (I suggest you backup all potential profile folders), but with some experimentation, you should be able to point Firefox back to using the correct profile folder.

I would know: I've had to do this more than a few times.