Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.
wiz0u edited this page Jun 1, 2018 · 13 revisions

Be warned: parts of this documentation are out of date, since I was forced to remake Open With from scratch.

How automatic browser detection works

Windows

Open With looks for entries in the Windows registry, under the key HKEY_KEY_LOCAL_MACHINE\Software\Clients\StartMenuInternet. It also looks for the presence of Microsoft Edge (Windows 10) in C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe (or if C:\Windows isn't your Windows directory, the corresponding place in your Windows directory).

OS X

Open With looks for .app files in your local applications directory. The browsers it looks for are: Camino, Google Chrome, Chromium, Firefox, Flock, Opera, Safari, and SeaMonkey.

Linux (and others)

Open With looks for google-chrome.desktop, chromium-browser.desktop, firefox.desktop, opera.desktop, and seamonkey.desktop in these locations: ~/.local/share/applications, /usr/local/share/applications/, and /usr/share/applications/.

Adding browsers

This is quite straight-forward. Click the Add button in the Open With options. On Windows, you're looking for a .exe or a .bat. On OS X it's a .app. On Linux, you want a .desktop or an executable.

You can duplicate an existing browser entry by clicking on it, and then clicking Duplicate.

Tips

Passing the URL in a particular place

If you add %s to the arguments for a browser, it will be replaced by the URL you're opening.

Windows note: If you're messing about with cmd.exe, you're gonna have a bad time if the URL you're opening has an ampersand (&) in it. This is because of some idiotic decision probably made in the '80s when DOS was being written. You can try to hack around it by adding a space and some quotes: "%s ".

Chromium/Google Chrome

There are a lot of command-line arguments for Chromium/Chrome. You might want to add --incognito or, if you want to debug Chrome using the Firefox developer tools, add --remote-debugging-port=9222.

Firefox

It's a little complicated to run more than one Firefox at once. You'll need separate profiles, and you'll want to add -P {other profile name} or --profile {location}, as well as --no-remote to the arguments. Even then all your problems aren't solved, but it is a start. Hopefully this situation will improve.

New in Open With 6.6 If you have Open With 6.6 installed in multiple running profiles, they will now talk to each other instead of trying to start a new operating system process, so you should no longer see the "Firefox is already running" message. (For those of you interested in how this stuff works, it uses a Unix domain socket where available, and a TCP socket elsewhere.)

Internet Explorer

I often get asked how to make Explorer open links in a new tab instead of a new window. I don't know. IE seems to do as it pleases.

Quotes

Generally, when you add quotes in a parameter, they're not there to be passed to the program. They're there to tell Open With (or Bash, or Windows command prompt) how to parse what you've entered. To see how Open With will split up a string, open the Browser Console and type something like this: OpenWithCore.splitArgs('foo bar "quoted string"'), which would display: Array [ "foo", "bar", "quoted string" ]

If you need a quote to be passed to a program (because programs are stupid), you can escape it, like this: \". (From v6.3 onwards.)

Customizing browser entries using about:config

(You can change almost all of these using the Open With options tab. Do that instead.) Firstly, some context. Each browser entry has a "key name" used for settings in about:config. For auto-detected browsers, the key name is auto. followed by the name of the file detected (firefox.exe in Windows, firefox in OS X, firefox.desktop in Linux). Edge is a special flower and has the key name auto.msedge. Manually added entries have a 8-character generated key name prefixed by manual., for example manual.zvsOKR6Y. You'll see the manual entries in about:config already. Some manual entries might not have a generated key name if you had an older version of Open With.

To set extra properties on a browser entry, add pref entries named extensions.openwith.{key name}.{pref}. Valid prefs are:

  • icon (string) The icon for the entry as a URL, usually a file:// URL.
  • keyinfo (string) The keyboard shortcut. Open With is fussy about the format. Use the options tab instead.
  • name (string) Name to display for the entry.
  • hidden (boolean, for automatic entries only) Whether this entry is hidden, obviously.
  • usefilepath (boolean, for manual entries only) If the URL to be opened is a file:// URL, pass the path to the file instead of a URL. Only really useful if you're trying to do something quite unusual.

openwith: URLs

This is a new feature in v6.3. A future version will have some UI to make it more useful.

The openwith: URL scheme is registered with the browser. This means you can save URLs that open in other browsers. They have the form openwith:browser.identifier:https://foo.com/, where browser.identifier is the identifier used to set prefs, e.g. auto.chromium or manual.2wLQck1O.

Other hints

If you hold Ctrl while you click on a browser's icon, Open With will not pass the current page's URL to the new browser, and your home page in that browser will open. Obviously this doesn't work when using a keyboard shortcut.