Giter Site home page Giter Site logo

Comments (5)

jcesarmobile avatar jcesarmobile commented on June 7, 2024

Original message:

I've been looking into issues and I have seen this one:
https://issues.apache.org/jira/browse/CB-8180

Right now the code to handle the tel links is inside the onPageStarted

if (url.startsWith(WebView.SCHEME_TEL)) {
try {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(url));
cordova.getActivity().startActivity(intent);
} catch (android.content.ActivityNotFoundException e) {
LOG.e(LOG_TAG, "Error dialing " + url + ": " + e.toString());
}
}

But the problem is, it launchs the intent and try to open the web page, so when you come back from the intent you see a "couldn't load the url" page on the app.

I've tried to use the view.stopLoading() but it doesn't seem to stop it.
The issue only talks about the tel links, but I suppose that will happen with sms, mailto and some other links.

So, I think a solution might be to move that code to shouldOverrideUrlLoading function.

Is there any reason of doing this on the onPageStarted instead of using the shouldOverrideUrlLoading?

from cordova-discuss.

jcesarmobile avatar jcesarmobile commented on June 7, 2024

@agrieve answer:
shouldOverrideUrlLoading is what the main cordova webview uses, so that's
certainly the right approach. I believe it should also add
CATEGORY_BROWSABLE to the intent to ensure that the user is prompted to
confirm whether they actually want to make the call.

from cordova-discuss.

jcesarmobile avatar jcesarmobile commented on June 7, 2024

The issue has been now assigned to @infil00p and on his comment on the issue he said:
This will probably be discussed on the list.

But I don't remember seeing this discussed on the mail list appart from my mail.

from cordova-discuss.

infil00p avatar infil00p commented on June 7, 2024

I asked what this should do in the ideal case. It should be in
InAppBrowser's shouldOverrideUrlLoading. Like most of our plugins, I kinda
want to re-write it all, but doing that just shows that I don't know what's
going on with this plugin. I think there's two issues that are directly
related to what you just talked about on this.

On Mon, Jun 22, 2015 at 1:44 PM Julio César [email protected]
wrote:

The issue has been now assigned to @infil00p https://github.com/infil00p
and on his comment on the issue he said:
This will probably be discussed on the list.

But I don't remember seeing this discussed on the mail list appart from my
mail.


Reply to this email directly or view it on GitHub
#10 (comment)
.

from cordova-discuss.

jcesarmobile avatar jcesarmobile commented on June 7, 2024

The issue was resolved long time ago, closing...

from cordova-discuss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.