Why browsers are driven to offer some degree of remote control

October 29, 2021

Not too long ago I wrote about changes in Firefox's remote control on Unix, and in that entry mentioned that probably all browsers on all platforms implement some degree of remote control. You might wonder why Firefox has a remote control feature and why this is probably a general thing. My belief is that there is a lesser and a greater reason, but to get there I'm going to start with a scenario.

Suppose that you're reading email in your mail client, and you hit a message with a link that you want to visit. You click on the link, the mail client does something and your browser starts on the link, and then you park the browser with the web page unread (as one does). You move on to another message, which also has a link you need to look at, so you click on the link, the mail client does something, and one way or another you can read the new web page.

One possible answer for what happened is that you now have two running copies of your browser, one displaying the first web page and the second displaying the second web page (and every new link you click in your mail client will start another copy of the browser). However, there are two problems with this. The lesser problem is that browsers are big, resource consuming things, so running extra copies of them is less than ideal. All browsers can open multiple windows or tabs, so it would be a significant resource saving if we could run just one copy and have it display all of the web pages.

The bigger problem is your web browser profile, which almost always contains things that your browser will want to update (such as your history and your current cookies). If there are multiple copies of your browser running they all need to coordinate access to your profile; they need to carefully lock it for updates, and probably to notify each other that important things have been updated. Essentially it's a shared database, and shared databases are pain points. Given the locking, it's also a fine way for one copy of the browser to cause another copy to perform badly, as the other copy waits for an update lock or to pick up new things or whatever.

Life is much easier if only one instance of the browser can be running in a given profile at a time. Then that browser instance can write updates to things out relatively freely and its internal information (such as your cookies) are as coherent between windows and tabs as it wants them to be (in the old days lots of things were always coherent, but these days they're increasingly isolated).

These two issues together provide strong motivation for browsers to implement some sort of remote control. This might be through a defined system API that browsers hook into (and your mail client uses), or it might be through the browser itself being able to find the master instance that currently owns access to a particular profile. The latter approach means that if people just run the browser (either from their desktop or a command line, with or without a URL), they get what they want.

Written on 29 October 2021.
« Things to do in Python 3 when your Unix standard input is badly encoded
Python 3 forced its own hand so that standard input had to be Unicode »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Fri Oct 29 23:01:03 2021
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.