Dial number from web page - javascript

I want to dial number using javascript.
I have used following code
document.location.href = "tel:15555551212"
It brings me to dial screen of mobile application. But I want to make a call directly.
I have also used "callto" but it is not working.

This is not possible, unless:
the Web browser holds the CALL_PHONE permission (so that the user knows at install time that this app might place phone calls), and
the Web browser exposes some means to have you place a phone call directly, perhaps via some DOM extension or magic snippet of JavaScript
Few, if any, browsers will meet these criteria.
A hybrid application (e.g., PhoneGap) could do this, given the proper permission and some API to enable it (e.g., PhoneGap plugin, if it is not part of the standard PhoneGap API).

You will probably need to use apache cordova to get access to native device APIs, including the one you can dial with. Link to the respective plugin
This is obviosuly only possible on mobile devices, and this plugin can only operate on iOS and Android. For more information about cordova, see this Link.

Related

Capture web page data using native language code

I'm looking for leads on how to capture web page metadata from the current browser page. I want to create a feature in my application that will allow the user to press a hot key and record meta data from the web page currently open in the user's browser. My application will be running minimized, this feature is to be activated by a global hot key.
I'm using nw.js (formerly Node-Webkit) to create this application, so ideally, the solution would be javascript running in a desktop installation of Node.js. If this is not practical, I understand that I can call platform specific code from nw.js, so solutions developed in any desktop os language would be of interest.
My application targets OS X and Windows.
I'm hoping to capture metadata from all major modern browsers (Chrome, Firefox, Safari and IE 10+).
At a minimum I need to capture the page url, but I also want to capture Keywords, Description and highlighted text for the source web page.
I need to implement this function without modifying the source webpage in any way, and I prefer to avoid the need for browser extensions, bookmarklets or plugins.
If a solution exists using a remote controlled browser extension (no user interaction) that would be of interest, but ideally I want to avoid requiring the end user to install or interact with anything but my application.
My search to date has located no information on reading web page information from applications outside the browser.
Any thoughts or leads are much appreciated.

How can I access to USB stick from website?

I'm planning to make a login system by USB, so if you put in a USB-drive and open a specific webpage, the website asks the USB-drive for the code (e.g. by a JavaScript file, a redirect or something like that).
The problem is, because of sandboxing, you can't load or redirect to local files. I don't know a solution for this problem. Can you guys help me? I don't need specific code, just an example or something in that way.
Maybe you can read up on USB-HID. Wikipedia:
The USB human interface device class (USB HID class) is a part of the USB specification for computer peripherals: it specifies a device class (a type of computer hardware) for human interface devices such as keyboards, mice, game controllers and alphanumeric display devices.
Here are some references:
USB HID (Human Interface Device)
node-hid - Access USB HID devices from node.js
DepthJS: 'Allows any web page to interact with the Microsoft Kinect using Javascript'.
A related Stackoverflow question:
Write data to USB HID using Javascript, HTML5, or any cross platform language (supports Android)
One other possibility is to check out the Chrome HID (Human Interface Device) APIs:
Interacting with USB HID devices from web apps – via Chrome Apps, see below
Relevant Chrome API docs
Please note that for the time being, you cannot interact directly with the USB device (i.e. you cannot access any WebAPI offering that kind of fine-grained control).
Building a Chrome App (different from a Chrome Extension) may help; This article may point you in the right direction, since it also provides sample code.
The only way I can think of is putting a html file on the usb stick that essentially generates some sort of login token and gives you a link or a form to a login processor. You can then access the webpage by opening the local file first which will redirect you to the actual webpage.
This local script may include a javascript from the server to get some challenge-response-data which it hashes somehow (perhaps in combination with a password) and puts it into the form data.
Web PKI authentication from Modern Browsers may be achieved by using Browser Extension. One such extension is Signer.Digital browser extension. Use below Javascript promises from the APIs provided by Signer.Digital extension.
SignerDigital.getSelectedCertificate() to register user's certificate
SignerDigital.signHash(hash) to sign token at browser and verify at server
For all Javascript APIs refer to SO Answer https://stackoverflow.com/a/63173083/9659885
Disclaimer : I work for a company supporting the application below
Hello, you may try to use Nexu open-source application for communication with smartcards or USB tokens. It also support PKCS 12 keystores.
For example, the application is connected to the DSS webpage on the website of European Commission : see the link.

Monitoring the displacement of a mobile device using GPS

I am wanting to develop an application for mobile devices, which shows in real time where a user (with this software installed on your mobile device) is. The idea would be that one (or more) users could follow the map the displacement of another user via GPS. I want to use PhoneGap with HTML5 and CSS and Javascript.
My question is: Is it possible to do that with these technologies? If yes, where can I get information of how to handle the GPS that way? If you can not, which language would give me this possibility and where can I get information? At first, I intend to develop this Application for Android and IOS.
Yes it’s very much possible with PhoneGap technology. You have to write a web service to keep the GPS coordinates as user updates (or auto updates) in server. You can let other users to connect to Web service and get the info they wanted (i.e. the data they wanted to see the current location of the user). You developed using PhoneGap means, it’ll work for iPhone too.
You can easily develop a web service either using PHP, Java or C# though C# web services are easy to write and maintain but PHP web servers are cheap compare to windows hosting (which you will need to host C# web service).
The question you asked is very broad so can write a 1000 words article and beyond. If you ask specific question I can answer that.

Build html5 javascript only using file :// uri protocol page for mobiles

I don't know if I googled it correctly but I could not find the answer for my question.
I'd like to know if it's possible to code a html5 with javascript (maybe jquery mobile for the UI) and css without using "native compilers/builders" like sencha touch or phonegap and store the page locally (using file:// protocol).
E.g: Let's say that I want to build a simple HTML5 calculator. I don't want any server-side processing, I just want some html buttons to call javascript functions to perform client side only operations. If I make such page, let's call it calc.html and download it to the mobile (via usb/http download), can I open this calc.html with the internal browser and use the calculator? Or do I have to compile/build this calc.html into a Webview (for Android) or something like it to get it done?
Would this work for Android, IPhone, Windows Phone and others with localStorage/sessionStorage?
You want an Offline Web Application.
This article seems to explains step by step how to do this.
http://diveintohtml5.info/offline.html
Creating a website like this, will allow you to bookmark it and have a shortcut icon in the phone's dashboard that will allow you to load your page in the browser for those cases where you don't have a data connection. In the case where the phone has a data connection, it will load the manifest to check if there are any new files to update the application. I don't think there is a way to make it truly offline though.

Get a tablets(iPad or Droid) mac address?

Synopsis: I am developing a HTML5 web app that will allow tablets(iPad or Droid) to login to a server and perform various functions. The client would like a way to check the devices mac address when logging in. From what I have read, most solutions use activex objects that will not work for webkit browsers.
Question: Does anyone know a solution that would hook into a HTML5 web app seamlessly(Idealy update a hidden form element with the value upon logging in)?
Thanks!
I don't think there's going to be a straightforward way to do this. The web server won't be exposed to a client's MAC address unless they're on the same physical segment...you'll only see the MAC from the most recent router hop in general.
If anything exists, it's going to be a browser plugin (show-stopper on iOS). And it would probably need more than the default permissions available (I don't suspect you can enumerate network interfaces in Java, for example, without asking for elevated permissions).
If you're looking for HTML/JS only then I don't think that this is possible. It won't be exposed.
The problem is that the packets you recieve back will only contain the MAC address of the node on the last hop.
This may be possible via a plugin, but then this limits you on iOS, and possibly also Android as you'd need to provide them a way of getting the plugin first (unless you used a plugin that was installed by default).
Edit: Not that I support an app for every little thing, but it shows that easy to press app buttons sometimes tend to do better than web apps (regardless of being able to make browser shortcuts to home screens). If it is suitable, you could consider loading this within a web view on the target device from within an app, from which you can then of course access MAC addresses and whatever else you may need.
MobiThinking: Mobile applications: native v Web apps – what are the pros and cons?
Forbes: Mobile Web App vs. Native App? It's Complicated

Categories