[qubes-users] How to open Thunderbird email URL link in a DVM

I had noticed that Thunderbird is capable of opening attachments in a
DVM via a Qubes specific plugin, and while this was great I wanted to
take this a step further by optionally opening URL links in a DVM when I
so choose. Unfortunately right clicking on a link in an email does not
give you the option to select a different browser or handler utility by
default.

After searching around a bit I found a way to do this and thought I
would share for anyone else that thinks this is also a good idea.

The first step is to modify Thunderbird for a selection box:

Edit -> Preferences -> [Config Editor] -> ["I'll be careful, I promise"]

Search for "network.protocol-handler.warn-external" in the top search
bar, and double-click each entry to change the values of
ftp,http,https,file to true. The 'default' is likely already set to true.

network.protocol-handler.warn-external-default true
network.protocol-handler.warn-external.file true
network.protocol-handler.warn-external.ftp true
network.protocol-handler.warn-external.http true
network.protocol-handler.warn-external.https true

You will now be given a selection box whenever clicking on a URL within
any Thunderbird email message.

Now create a batch script file like:
% cat <your-script-name>
#!/bin/bash
qvm-run '$dispvm' /bin/firefox $1

% chmod 755 <your-script-name>

Now, attempt to open any url in a Thunderbird email, and when presented
the initial selection box locate your script and select it. You can now
easily select between a normal firefox in your current AppVM or a dvm
version of firefox when opening any URL from within an email.

My only open question would be on the possibility of malformed URL's and
how the "qvm-run ... $1" command might handle those patterns on the
local VM side. The $1 probably should be sanitized for ";,()<cr><lf>"s
before passing it on to qvm-run. I also created a script that
echos/copies the link to a file containing a simple html file with an
embedded redirection, and instead calls qvm-open-in-dvm on that html
file. Both methods work fine but the first seems cleaner since there is
no temporary file needed to be deleted after the command is run.

Any comments?

Thanks,

Steve.

Alternatively, you can also use /bin/qvm-open-in-dvm as the "open with" application, no shell script required.

Cheers, TJ

1 Like

The later approach is exactly what qvm-open-in-dvm already does when started
with link as the parameter.

This would be very handy from a browser (firefox) as well...
Currently we have these option (if right click on any url)
- Open in new Tab
- Open in new Window
- Open in new Private Window

I really missing the:
- Open in new DVM option.

Does it require a plugin? or it can be achieved by some local configuration?

Thanks.

I added the Firefox plugin called "Open With" to handle this. It works
great. Just search the Firefox plugins by name.

Developers site:

I pointed it at this script:

#!/bin/bash
qvm-run '$dispvm' /bin/firefox $1

I can now right click on any liink and get both a "open firefox in dvm"
entry and an open in google-chrome for website testing purposes. In fact
any application that takes a URL as a parameter can be launched this way.

Whatever you do, be careful not to accidentally open an AnonVM link in a
DispVM if your DispVMs are connected to the clearnet (e.g., connected
directly to the "firewallvm" ProxyVM) by default.