Closed Bug 1691710 Opened 4 years ago Closed 4 years ago

Websocket connection beeing terminated when following 'tel:' - links

Categories

(Core :: Networking: WebSockets, defect)

Firefox 85
defect

Tracking

()

RESOLVED DUPLICATE of bug 896666

People

(Reporter: michael, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0

Steps to reproduce:

I'm using a (local) webpage containing customer contacts. It contains related phone numbers, formatted as 'tel:xxxxx' - links as a shortcut for initiating phone calls (runs on Windows).
The page also establishes a websocket-connection to the server for item updates.
The connection remains stable, only by using these 'tel:' links it's terminated.

Actual results:

Websocket connections are beeing closed when 'tel:'-links are clicked to initiate phone calls (for sure leaving the site is not intended).
The connection can be reestablished at once in the 'onclose'-event without problems.

Expected results:

I'd expect that websocket connections wouldn't be terminated, as they remain when following 'mailto:'-links...

Michael, are you seeing anything displayed in the web console or browser console? Did this ever worked for you in Firefox or is it a recent issue?
I'm going to assign this to the Networking: WebSockets component so that someone more experienced could take a look.

Component: Untriaged → Networking: WebSockets
Flags: needinfo?(michael)
Product: Firefox → Core

Helllo Simona,

I added the websocket-functionality only a few days ago, so I can't say if this would have happened with earlier versions of Firefox. In the 'onclose'-event of websockets I send the CloseEvent object to the console, the most interesting property I think is 'code' which says 1006.
There are no further errors or issues, I reopen the websocket connection every time it disconnects - without problems.
But I can't believe this is intended behaviour.
There are no other situations where websockets get disconnected (except when really leaving the page.... :-) so I think my websocket code should be ok.

Best regards,
Michael

Flags: needinfo?(michael)

Kershaw can you take a look?

Flags: needinfo?(kershaw)

Hi Michael,

Is it possible to provide us a simple test case for reproducing this issue?

Thanks.

Flags: needinfo?(kershaw) → needinfo?(michael)

Hello,

I found an example to test on the net. Try: https://medium.com/@cn007b/super-simple-php-websocket-example-ea2cd5893575
(only php-script is needed; I copied it to my testserver and started it there in a shell).

On the client side use this (it's the slightly modified example frop that page; I added the 'a'-element):

<html>
<body>
<div id="root"></div>
<a href="tel:1234" data-tel="1234" data-name="Example" data-protocol="tel">Example</a>
<script>
var host = 'ws://SERVER-IP-ADDRESS:12345/websockets.php';
var socket = new WebSocket(host);
socket.onmessage = function (e)
{
document.getElementById('root').innerHTML = e.data;
};
</script>
</body>
</html>

I was able to repeat the error with this example - when the connection to the php-server-script was established you can see the timestamp counting upwards in the top left corner. When the tel:-link is clicked it stops due to disconnecting the websocket connection.
I think this shouldn't happen until a link is clicked which refers to another page or when reloading the page...

Best regards,
Michael

Flags: needinfo?(michael)

It seems to me that the websocket is killed because we attempt to navigate the page to the tel: URL.
Seems like a dupe of bug 896666.

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

Any workaround? The issue has been known since 9 years, I don't want to hold my breath...

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