sailfishos / sailfish-browser

Sailfish Browser
https://github.com/sailfishos/sailfish-browser/wiki/Sailfish-Browser-wiki
Mozilla Public License 2.0
305 stars 86 forks source link

Small inconsistency in calling from Browser #936

Open atlochowski opened 2 years ago

atlochowski commented 2 years ago

I understand that when you tap and hold on phone numer on some website you can call only when SIM card is activated. https://github.com/sailfishos/sailfish-browser/pull/542/commits/b6acba078936dd4e1e99d5cf267377d2157a56b1

But why not to block calling when you tap link like tel:+48798809709 when SIM card is not activated?

rainemak commented 2 years ago

Short story: Link handling and delegating external uri schemes to target application is done in the side engine. Hence, implementing this would be much more complex and there are higher priority items.

Longer story: Should the engine load a uri gets triggered from nsDocShell [1]. I vaguely remember/recall that this test is done too late. For time being let's assume that we could block it and handle it in nsDocShell. That would imply that we'd need to implement nsIWebBrowserChrome3 for the WebBrowserChrome and do special handling for tel scheme in the shouldLoadURI and check modem / sim statuses. This would be simplest and cleanest solution that comes to my mind. Surely, that are and can be other approaches as well.

[1] https://github.com/sailfishos-mirror/gecko-dev/blob/esr78/docshell/base/nsDocShell.cpp#L8557

[2] https://github.com/sailfishos-mirror/gecko-dev/blob/esr78/toolkit/components/browser/nsIWebBrowserChrome3.idl