Closed Bug 1822696 Opened 3 years ago Closed 3 years ago

webRequest.onBeforeRequest isn't triggered at all for clicked links in email message

Categories

(Thunderbird :: Add-Ons: Extensions API, defect)

Thunderbird 102
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: mszpak, Unassigned)

Details

Attachments

(1 file)

Steps to reproduce:

TL;TR:

  1. Write a simple extension with a listener on browser.webRequest.onBeforeRequest.
  2. Click any HTTP(S) link in an email message.

Longer description:
I was missing an add-on to whitelist clickable URLs to mitigate (spear)phishing attacks (see at the end for the reasons), so I wanted to write my own. Using the hello world tutorial in the Thunderbird documentation, I was able to write one, however, I hit the problem with not triggered "webRequest.onBeforeRequest".

When I load the extension in the debug mode, it is loaded, "initialization" is print. Unfortunately, when I click any http/https link in my email (which are open in Firefox), nothing is caught by the callback.

I also tried "webNavigation.onBeforeNavigate" which works. However, I need the real URL not "mailbox:///home/foobar/.thunderbird/abcd.default/Mail/example.com/Inbox?number=1234".

I attached a simple extension to reproduce the problem.

Here's a thread when I originally described the problem and I've got a suggestion from John Bieling to report a bug to get it fixed in Thunderbird:
https://thunderbird.topicbox.com/groups/addons/T37675249e8aa089e/webrequest-onbeforerequest-isnt-triggered-at-all

Actual results:

The listener is not called. Not at all.

Expected results:

The listener is called and it is possible to do some actions (e.g. block blacklisted domains).

The webRequest is not handled by Thunderbird. It is forwarded to your default Browser, for example Firefox. The add-on to manipulate the request needs to be loaded into that browser.

We deliberately do not handle such links on our own (and open them within Thunderbird).

However, there is an add-on which changes that behaviour:
https://addons.thunderbird.net/addon/browseintab/

If you install that, you will see the webRequest being handled by Thunderbird.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: