Closed Bug 1727245 Opened 4 years ago Closed 4 years ago

Href inside a browser (openTab)

Categories

(Thunderbird :: Add-Ons: General, defect)

Thunderbird 91
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: adrien.rybarczyk, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Steps to reproduce:

  1. Create a extension with a function call with openTab.
    Example : Services.wm.getMostRecentWindow("mail:3pane").document.getElementById("tabmail").openTab
  2. In the html code of the opened page a link with an href containing a javascript call.
    Example : <a HREF="javascript:alert('test')">test link</a>
  3. Click on the link

Actual results:

Nothing happens and we get an error in console (2147942487).

Expected results:

The link works.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID

Thank you for the answer. I tried, there was no error in console. But in the case of the example proposed, the alert does not go off.

There are multiple issues with the example. You should not use javascript href links, but use an eventlistener for the click event to run a javascript function. And alert is probably not allowed for WebExtensions. Use console.log to have a visual feedback when the call has been executed, or use the debugger [1].

For further questions regarding WebExtension programming, please use our other channels [2].

[1] https://extensionworkshop.com/documentation/develop/debugging/
[2] https://developer.thunderbird.net/add-ons/community

You need to log in before you can comment on or make changes to this bug.