Closed Bug 1627649 Opened 4 months ago Closed 3 months ago

Unable to use WebSocket in Thunderbird

Categories

(Thunderbird :: General, defect)

defect

Tracking

(thunderbird_esr68 fixed, thunderbird77 fixed)

RESOLVED FIXED
Thunderbird 78.0
Tracking Status
thunderbird_esr68 --- fixed
thunderbird77 --- fixed

People

(Reporter: sephir, Assigned: mkmelin)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

First, the following was tried on Thunderbird 75.0b3 and 68.6.0.

I tried to use WebSockets in a very simple WebExtension.

The background.js only have the following code:

console.log("a");
let ws = new WebSocket("wss://echo.websocket.org/");
console.log("b");

I also tried to open a WebSocket in the debugging console directly by just typing the following code:

let ws = new WebSocket("wss://echo.websocket.org");

I tried the same on Firefox 76.0a1 (2020-04-05) (64-bit). Both, background.js and console tries worked.

Actual results:

As a result, in the debugging console, I only got this result:

a background.js:1:9
: background.js:2
    <anonymous> moz-extension://aa11cfda-f35c-4d6d-ae9a-1f3595103d4f/background.js:2

As you can see, the error returned by the console is totally empty.
When trying to catch the Exception inside a try-catch block, the Exception returned is totally empty.


When entering the code directly in the console, I get another error:

undefined
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIInterfaceRequestor.getInterface]

Expected results:

I expect to get a fully working WebSocket, as it is the case with Firefox.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Actually, this is a general fault - websocket is not working in Thunderbird.

STR: load https://www.websocket.org/echo.html into the start page. Try pressing "Connect" - nothing happens.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Component: Add-Ons: Extensions API → General
Summary: Unable to use WebSocket in WebExtension → Unable to use WebSocket in Thunderbird

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is -- (Backlog,) indicating it has has not been previously triaged, the bug's Severity is being updated to -- (default, untriaged.)

Severity: normal → --
Comment on attachment 9147424 [details] [diff] [review]
bug1627649_tb_websocket.patch

Review of attachment 9147424 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #9147424 - Flags: review?(benc) → review+

The earlier patch was not 100% right. I added some clarifying comments in the code

Attachment #9147424 - Attachment is obsolete: true
Attachment #9148084 - Flags: review?(benc)
Comment on attachment 9148084 [details] [diff] [review]
bug1627649_tb_websocket.patch

Review of attachment 9148084 [details] [diff] [review]:
-----------------------------------------------------------------

I don't pretend to follow the nuances of contentpolicy (regarding your data:// changes), but mechanically it all looks fine to me.

::: mail/test/browser/content-policy/browser_generalContentPolicy.js
@@ +529,5 @@
>    assert_nothing_selected();
>  
>    for (let i = 0; i < TESTS.length; ++i) {
>      // Check for denied in mail
> +    dump("Doing test: " + TESTS[i].description + " ...\n");

Is there any policy/standard that for logging output for mochitests that should be followed here?
Attachment #9148084 - Flags: review?(benc) → review+

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/b5cb669844cd
Unable to use WebSocket in Thunderbird. r=benc DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Comment on attachment 9148084 [details] [diff] [review]
bug1627649_tb_websocket.patch

[Approval Request Comment]
Regression caused by (bug #): No regression, never worked.
User impact if declined: Would be nice if add-ons could use this asap.
Risk to taking this patch (and alternatives if risky): Not risky to existing functionality, just allowing some additional URL schemes "ws" and "wss".
Attachment #9148084 - Flags: approval-comm-esr68?
Attachment #9148084 - Flags: approval-comm-beta?

(In reply to Ben Campbell from comment #6)

Is there any policy/standard that for logging output for mochitests that should be followed here?

I think there's some other way, but I can't seem to find it atm. Subtests of the type used here are hard to debug without output since it's the same "checks" so line numbers do not help due to changing data.

Target Milestone: --- → Thunderbird 78.0
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/936dbd8706b8
followup - use info() instead of dump() for the mochitest debugging. rs=me DONTBUILD

Are you able to verify it's working in the webextension you have with current nightly builds?

Flags: needinfo?(sephir)

(In reply to Magnus Melin [:mkmelin] from comment #11)

Are you able to verify it's working in the webextension you have with current nightly builds?

It seems to work properly! Thanks!

Flags: needinfo?(sephir)
Comment on attachment 9148084 [details] [diff] [review]
bug1627649_tb_websocket.patch

Approved for beta, per comment 12 and Jorg's assessment.

Thanks
Attachment #9148084 - Flags: approval-comm-beta? → approval-comm-beta+
Comment on attachment 9148084 [details] [diff] [review]
bug1627649_tb_websocket.patch

[Triage Comment]
Approved for ESR. Risks, etc per comment 8
Attachment #9148084 - Flags: approval-comm-esr68? → approval-comm-esr68+
You need to log in before you can comment on or make changes to this bug.