what is exactly a "default browser" ?

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Lucio Chiappetti
Astronaut
Astronaut
Posts: 654
Joined: 2014-09-01, 15:11
Location: Milan Italy

what is exactly a "default browser" ?

Unread post by Lucio Chiappetti » 2014-12-01, 09:43

A curiosity I had since long ago (when I was a FF user), and still have now that I am a PM user.

When a fresh browser version is installed, the first time (and all subsequent times if I do not reply yes or say not to show the message anymore) it will ask whether I want to make xxxx the default browser.

I have never understood which difference it makes whether I answer yes or no (it looks like it makes no difference for me). Is this some form of MSwindow-ism irrelevant on Linux ? (BTW I am on Linux and use a minimalist fvwm as window manager)
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

New Tobin Paradigm

Re: what is exactly a "default browser" ?

Unread post by New Tobin Paradigm » 2014-12-01, 09:55

To put this simply. When you set a browser (or any program) as default it becomes the program that opens for a particular action. Linux has this as well. For a browser being default say Pale Moon, it associates its self with some file types like .html and associates it with url protocol handlers. This means when you click a link (out side the browser like in an IM or in a PDF in Acrobat Reader) everything with http:// will open with Pale Moon. By default.

This is demonstrated in many other programs as well. Such as opening all .mp3 files with Media Player Classic instead of Windows Media Player or opening .doc files with OpenOffice instead of Microsoft Office or opening a .png file with Photoshop instead of MS Paint.

Lucio Chiappetti
Astronaut
Astronaut
Posts: 654
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: what is exactly a "default browser" ?

Unread post by Lucio Chiappetti » 2014-12-01, 10:48

Well. I wondered whether Linux had that, and in particular how PM (and FF) implement it, because I do not see any obvious user file showing up in home to store the info.

In general the mechanism you describe is similar to the mailcap and mime.types files, and actually my old-time curiosity was kindled afresh last Friday when I had to help a colleague which had a new version of his mail user agent (Alpine 2.11) and had lost the configuration info which allowed him to click on an URL and have it displayed in his browser (FF). So I reexamined the way I do it (with Alpine 2.00 and PM) and that occurs pointing the alpine config file to both a list of custom mailcap and mime.types files and some internal wrappers. Anyhow they had to be set manually, they did not use any "default browser" (and in fact one of the first things I did when moving from FF to PM was editing the wrappers).

Which raised a side questions on browsers of the Mozilla family (I guess that both FF and PM can be called like that), namely on the runstring argument -remote "ping()" and -remote "openURL($1)" (which is what those wrappers use). Apparently these features (which date back to netscape) are not documented in palemoon -help nor in firefox -help at least down to 3.6, but continue to work nicely.

Another old question of mine (in this case more a rant than a curiosity) is that I've never particularly liked the way FF (and hence PM) associates Action to Content Type in the Preferences->Application menu, bypassing the mailcap and mime.types files used by good old unix applications (netscape did).

BTW I've just verified that acrobat reader correctly (sort of) fires palemoon when I click on an http URL in a PDF document. I say "sort of" because it fires three identical instances (two new windows and one new tab), but that PM behaviour was the same with FF. In the acrobat Preferences->Internet the browser points to palemoon ... but I can't remember whether I edited that manually last September or it picked up in a way unknown to me from the "default browser" mysterious info (my notes said I tested that soon after I first installed PM, but do not tell what I did)
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

New Tobin Paradigm

Re: what is exactly a "default browser" ?

Unread post by New Tobin Paradigm » 2014-12-01, 11:48

In general the shell decides how associations work. In linux it would be the Desktop Environment you use when it is in that type of situation.

access2godzilla

Re: what is exactly a "default browser" ?

Unread post by access2godzilla » 2014-12-01, 14:16

Pale Moon and Firefox register file associations by creating a rudimentary .desktop file in ~/.local/share/applications/userapp-{appname}-{random}.desktop and registering associations with respect to that file. You can inspect ~/.local/share/applications/mimeapps.list to check this.

However, some systems (depending on DE, default app handlers etc.) might not still see it as the default browser. For example, on XFCE, it needs separate configuration, which creates a ~/.local/share/xfce4/helpers/custom-webBrowser.desktop.

Lucio Chiappetti
Astronaut
Astronaut
Posts: 654
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: what is exactly a "default browser" ?

Unread post by Lucio Chiappetti » 2014-12-01, 14:23

So I believe for me it can be a no-operation as I suspected.

I have no such thing as a "desktop environment" (no KDE, no Gnome) but just a plain old window manager (fvwm) controlled by a single configuration file, and it cannot and was not updated except than manually by me (and I just replaced firefox with palemoon in the list of applications to be started at login).

And "the shell" to decide must read it from the environment and set it at .login or .cshrc level, and also these files, nor any other obvious file, weren't modified at PMinstallation and first start.

EDIT: I posted this before seeing the message of access2godzilla ... I'm now going to check the places he mentions !
Yes in fact ... there are userapp-Pale Moon-DBE5LX.desktop, userapp-Pale Moon-QI88PX.desktop, and userapp-Firefox-269IDX.desktop there ! and mimeapps.list refers to them in this order
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

access2godzilla

Re: what is exactly a "default browser" ?

Unread post by access2godzilla » 2014-12-01, 14:51

It might not be "no operation": it all depends upon what your WM/DE wants to use. But as long as it implements the freedesktop.org specs in some measure, it should at least show some configuration. xdg-open should also respect those prefs but its a different case in some distros like Linux Mint.

You might want to read these articles regarding file associations:
https://wiki.archlinux.org/index.php/de ... plications
https://wiki.archlinux.org/index.php/Desktop_entries
https://wiki.archlinux.org/index.php/xdg-open

Lucio Chiappetti
Astronaut
Astronaut
Posts: 654
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: what is exactly a "default browser" ?

Unread post by Lucio Chiappetti » 2014-12-01, 17:05

Thanks for the instructive readings. I guess my approach could be defined "not modern" according to the first link :mrgreen: but my favourite window manager (FVWM http://www.fvwm.org/) looks kicking and alive as my favourite mailuser agent Alpine (http://patches.freeiz.com/alpine/) though they aren't compliant with freedesktop.org nor use a true "desktop".

All this is quite OT with PM, as might be my preference for plain ascii configuration files like .Xdefaults or mailcap. The following however can be more in topic. The way PM associates Actions to Content Type in Preference->Application seems the same ihherited from FF (aren't there any plans to change it ?) and ignores the user mailcap. The original netscape way was different.

What I lack is an easy way of adding interactively new "content types" and somehow (conditionally ?) override the choice of viewer, including the possibility of using the browser as viewer. Just two examples: sometimes I receive e-mail attachments which are pdf files but are declared the wrong content-type (e.g. octet-stream) ... I have been able to instruct my MUA to open them via acrobat after having asked confirmation. What sometimes happens with the browser is that some sites (actually phpbb forums as this one) attach some e.g. png image which the browser is uncapable to handle and offers as only option to save it to disk. Or proposes the wrong handler (say gimp instead of xv),

Maybe there are any addon which deals gracefully with such cases ?
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

etosan

Re: what is exactly a "default browser" ?

Unread post by etosan » 2014-12-11, 16:13

Lucio Chiappetti wrote:MSwindow-ism irrelevant on Linux ?
Well if you haven't noticed Linux is New Windows :) nowadays, or one could say OS X in case of gnome. So naturally their ideas are taken in. There is half-assed attempt to make some kind of specs out of it at outdated wiki at freedesktop.org as was pointed out. Which some programs implemnt and some do not. Terminal/console programs, alterantive window managers usually leave those decisions on users, however fun begins when you run some application which does "respect" those specs, which might very well end up launching wrong thing at the most inappropirate time. Only way is to move with times and try provide just enough settings so that modt of your stack "works" as intended.

Locked