Bluetooth API in Chrome for Android Beta - javascript

Does Chrome for Android Beta have a bluetooth (javascript) API? Google reports that Chrome Beta and Dev channels have the bluetooth api [1] but I cannot call it on Android and Desktop versions of Chrome Beta.
I check for the api by evaluating chrome.bluetooth:
if(!chrome.bluetooth) {
logError('bluetooth api not found');
return;
}
Is there any way (programmatically, or other) to check what apis are supported in a particular Chrome version? console.log(JSON.stringify(chrome)) doesn't do it.
[1] https://developer.chrome.com/apps/api_index

Answering my own question: It appears the API are only available to Chrome Packaged Apps and Extensions. Furthermore, an API is only exposed if listed in the manifest.json file. In other words, there appears to be no easy way to programmatically list the API available.

An experimental Web Bluetooth API is being added as we speak (not literally of course) in Chrome Dev for Android.
Check out https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web to learn more about it.

Related

Uncaught TypeError: navigator.getBattery is not a function

I'm developping a website which is meant to be used on mobile devices using Google Chrome, the purpose is to list information such as time (hh:mm) and battery level.
I saw the Battery Web API but I'm experiencing a strange error:
click to see the chrome error
Here is the code I used in order to get the battery level:
navigator.getBattery().then(function (battery) {
console.log(Math.round(battery.level * 100))
});
I had the error yesterday, without changing any line of code, it is working today on my tablet (chrome version: 103), but I tested on another tablet (Samsung Galaxy TAB A7 LITE, Chrome version: 103) and I encounter the error, I restarted several times the devices, inspected pages using the devtools connected by cable to my laptop, but I can't solve this error.
I saw a topic having the same error but he was developing a web worker it is not the same context as I.
No matter when I'm calling the navigator.getBattery() if the error appeared in the beginning it will stay undefined later, so it is not a problem of timing to call it (I even bound it to the body.onload but it didn't work).
I thought it could be authorization issues on system information but there's nothing refering to the battery which is not authorized in the application settings of Chrome.
Any help is welcome :D
I found out where my error was coming from.
It is a problem of HTTPS, my testing environment is configured behind a NGINX HTTP Server, which serves HTTP and HTTPS version of my application in order to use a single certificate for every of my projects, Chrome on my laptop prefix URLs I'm accessing with https:// and it is hidden in the navbar, but it is not the case on Chrome tablet or mobile, I thought I was consulting the HTTPS version but it was HTTP, and Battery Web API isn't accessible on HTTP websites, it is required to have a secure connection using HTTPS and certificates. It has nothing to do with version number since Battery Web API is fully supported since Chrome version 38 according to MDN Documentation.

access web serial api in android chrome browser

using web serial API in windows, mac os, and Linux chrome browser I can receive and send data. but in the android chrome browser, I am not able to send or receive data from a serial device.
so which API is used to read and write data to serial devices in the android chrome browser.
also, there is a polyfill serial API for android chrome but is showing an error shown in the image.
The team that built the implementation of the Web Serial API in Chromium also wrote a polyfill library which uses WebUSB to support platforms which don't provide built-in serial drivers: https://github.com/google/web-serial-polyfill
It looks like you are already trying to use this library. Can you file an issue on the library's GitHub project so the team can look at the error you're seeing?
Note, it seems like there are some Android devices which have USB serial drivers that end up blocking WebUSB from claiming interfaces even though the platform doesn't let apps actually use them. https://crbug.com/1099521 is tracking a workaround for that.

How can I debug an Outlook App running in Desktop

I've been working on an Outlook Add-in, which is now working fine as a prototype in Outlook Web App and indeed works - usually - in Desktop too; but I find sometimes the App freezes in Desktop (not in the Web App) but I can't find how to debug the Desktop; none of the given Microsoft options seem to apply - am I missing something?
Tech note: I've tried Microsoft Edge DevTools, but it can't see the app to attach to it; I'm thinking that might be because the Outlook Add-in only runs momentarily …?
Here is Microsoft's docs for how to test and debug addins.

Why does Google hangouts support sharing desktop without Chrome Extension in latest Chrome?

As far as I know, in browser, such as Chrome, sharing desktop or application needs a Chrome Extension to work, eg:
chrome.permissions.request({
permissions: ['desktopCapture'],
}
But why does Google Hangouts do not need any extension to capture desktop?
Is there any API of JavaScript for this?
As of now, Google Hangouts does use an extension, it's just integrated into Chrome to the point of not being visible.
Source: Chromium issue to remove this special treatment
You can test that it is (stealthily) installed by manually opening
chrome-extension://nkeimhogjdpnpccoofpliimaahmaaome/background.html
At the same time, work is ongoing to support WebRTC spec for screen sharing (getDisplayMedia) in Chrome. It's not yet enabled by default in released Chrome versions, but will be very soon (code is already in the codebase).
Implementation tracking: Chromium issue

Web MIDI API not implemented in Chrome Canary?

Support for the Web MIDI API has been added to Chrome Canary since early 2013.
Why then, when I type requestMIDIAccess in the JavaScript console and hit enter, do I get "ReferenceError: requestMIDIAccess is not defined"?
According to official documentation, it should be a defined function.
What gives?
The Web MIDI API is available by default only in Chrome versions 43 and newer.
In earlier versions it is not enabled by default, but can be enabled as an experimental feature flag. In Chrome, load the special URL chrome://flags and search within the page for "Enable Web MIDI API".
The options on the flags page require the browser to be restarted before they will take effect. The features hidden behind these flags are in an experimental state and are subject to change at any time, so the API in older versions may differ from what is available in Chrome 43.
Note also that the requestMIDIAccess function is a method of window.navigator, not directly of window. Therefore you need to call it as navigator.requestMIDIAccess.
Also note that after you plug-in a new MIDI device, you may need to quit and restart Chrome. It does not seem to handle dynamic adjustment of the device list.

Categories

Resources