Codementor Events

The new proposal – Web device manager API

Published Feb 03, 2019
The new proposal – Web device manager API

Welcome back! Apologies for not writing for a long time, but many things have happened in my personal life, and I didn’t have a spare time to write.

I’ll jump straightaway to the point, I have released a proposal for a new API. I do think that a proposed API might be an excellent idea and improvement, especially for e-commerce and gamers.

1. What is it?

The Web Device Manager API is allowing the user to expose their devices included in the configuration of the machine in use. The entire operation of exposing is not going to be invoked without acceptance of the user who is the owner of the local machine in use.

The following API is going to request the user to grant permission to read the machine's configuration and list of devices and their included setting and properties. If the user didn't grant the permissions for the web browser to read the list of devices included in the configuration of the local machine, the API would throw specific error informing the user that the operation will not be performed without acceptance to access the devices list.

2. What is the usage?

2.1. The user would be able to access the website where they can verify the list of available devices on the local machine and check the status of their drivers. If one of the drivers is not up-to-date, then the website based on APIs properties related to the device is going to offer you a possibility to update to the latest version of the driver.

What is the current issue with the above statement?

The problem appears often; reportedly it is malware which infects local machines of users because of fake installers or fake websites which hunt users and tells them to click on the button to verify their hardware and download latest drivers which are not the case.

How can we prevent above behaviour from spinning?

The following API, if implemented, will be marking the website that uses it as a trusted source of drivers update, which will not appear on the projects that mean to infects you by malware. You will not be able to implement the API if your project doesn't use an HTTPS connection.

2.2. A developer who is going to create a project by using the mentioned Web API will be able to create applications for the following purposes:

  1. Analyse data
  2. Test games' requirements
  3. Detect outdated drivers on users' machines.
  4. Gaming industry - Developers will be able to match performant game configuration based on the user's hardware
  5. E-commerce usage - create related products sliders that provide more accurate offer based on the user's hardware configuration
  6. Marketing usage - Ads based on the current user's machine configuration
  7. Detection of hardware to support World community grid organisation

3. Caution

Even if the browser marks the website as a trustful source to update the out-dated drivers, it doesn't exclude the user from having antivirus software installed on the local machine. The website even if marked as trustful one, can offer malware content. The trustful mark doesn't give you a guarantee that the web page doesn't contain malware.

4. Syntax

const deviceManager = new DeviceManager({
    detailed: false,
    configuration: true
})
.then(response => response.json())
.then(data => data)
.catch(error => error);

The API is going to provide a constructor called DeviceManager that is going to take one parameter which is an object containing two properties, listed below.

detailed
configuration
Both properties mentioned above are the boolean ones.

4.1. detailed property

A detailed property helps the developer to specify and perform filtering to bring a significant number of devices needed to run the machine. In a simple example, if we set the property to true, we're going to receive a full list of available user's devices. If we set the property to false, we're going to receive a list of significant parts of the machine needed to run the processes.

4.2. configuration property

A configuration property has a lot to offer for developers. The property allows bringing all of the available settings and properties of the devices available on the user's machine. If we set the property to true, we're going to receive a full list of settings for a specific device as a nested object. If we set the property to false, we're going to receive a basic list of settings for a specific device as a nested object.

The response returned by API is going to be handled by promises.

I hope you enjoyed reading it; it is a new proposal. I'm aware that it can have an impact on privacy, but I'm also sure that it is an excellent API that can be adapted by e-commerce and gamers.

Discover and read more posts from Robert Wozniak
get started
post commentsBe the first to share your opinion
Show more replies