How to open Thunderbird email URL link in a DVM

182 views
Skip to first unread message

Steve Coleman

unread,
Oct 7, 2013, 1:42:06 PM10/7/13
to qubes...@googlegroups.com
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.

Tokyo Jeff

unread,
Oct 7, 2013, 3:49:48 PM10/7/13
to qubes...@googlegroups.com
Alternatively, you can also use /bin/qvm-open-in-dvm as the "open with"
application, no shell script required.

Cheers, TJ

Marek Marczykowski-Górecki

unread,
Oct 7, 2013, 4:00:39 PM10/7/13
to Steve Coleman, qubes...@googlegroups.com
The later approach is exactly what qvm-open-in-dvm already does when started
with link as the parameter.

--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

signature.asc

Zrubecz Laszlo

unread,
Oct 8, 2013, 1:58:57 AM10/8/13
to qubes...@googlegroups.com
On 7 October 2013 22:00, Marek Marczykowski-Górecki
<marm...@invisiblethingslab.com> wrote:
> 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.



--
Zrubi

Steve Coleman

unread,
Oct 8, 2013, 12:42:18 PM10/8/13
to Zrubecz Laszlo, qubes...@googlegroups.com
I added the Firefox plugin called "Open With" to handle this. It works
great. Just search the Firefox plugins by name.

Developers site:
http://www.darktrojan.net/software/addons/openwith

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.


On 10/08/13 01:58, Zrubecz Laszlo wrote:
> On 7 October 2013 22:00, Marek Marczykowski-G�recki

Axon

unread,
Oct 9, 2013, 1:49:31 AM10/9/13
to Steve Coleman, Zrubecz Laszlo, qubes...@googlegroups.com
On 10/08/13 09:42, Steve Coleman wrote:
> I added the Firefox plugin called "Open With" to handle this. It works
> great. Just search the Firefox plugins by name.
>
> Developers site:
> http://www.darktrojan.net/software/addons/openwith
>
> 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.
>
>
> On 10/08/13 01:58, Zrubecz Laszlo wrote:
>> On 7 October 2013 22:00, Marek Marczykowski-Górecki
>> <marm...@invisiblethingslab.com> wrote:
>>> 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.
>>
>>
>>
>

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.

signature.asc
Reply all
Reply to author
Forward
0 new messages