chrome.enterprise.hardwarePlatform.getHardwarePlatformInfo --- Isn't working

285 views
Skip to first unread message

Matthew Nichols

unread,
May 28, 2020, 3:20:50 PM5/28/20
to Chromium Extensions
I am trying to get the model info of our chromebooks with:
     chrome.enterprise.hardwarePlatform.getHardwarePlatformInfo((info)=>
{
$('#info').append("<b>Model: " + info + "<br><hr>");
});


But it always returns "undefined". 

I am getting other device attributes fine (with the code shown below) the only one I cant get working is the , "Get device model" (Hardware platform info). Any thoughts? This extension is being forced installed to our devices.


function displayInfo( JSONObject, Heading, noHR)
{
$('#info').append("<b><h3>" + Heading + "</h3></b><br>");
for (var key in JSONObject) 
{
if (JSONObject.hasOwnProperty(key)) 
{
var val = JSONObject[key];
$('#info').append("<b>" + key + " :</b> " + val + "<br>");
}
}
if(noHR == true)
{
//
}
else
{
$('#info').append("<hr>");
}
}

function populateDeviceInfo() {
  // Get User
chrome.identity.getProfileUserInfo((info)=>
{
displayInfo(info, "User Profile");
});
//get Device ID
chrome.enterprise.deviceAttributes.getDirectoryDeviceId((info)=>
{
$('#info').append("<b>Device ID: " + info + "<br><hr>");
});
//Get Serial Number
chrome.enterprise.deviceAttributes.getDeviceSerialNumber((info)=>
{
$('#info').append("<b>Serial Number: " + info + "<br><hr>");
});
//Get Asset Tag
chrome.enterprise.deviceAttributes.getDeviceAssetId((info)=>
{
$('#info').append("<b>Asset Tag: " + info + "<br><hr>");
});
//Get Device Model
chrome.enterprise.hardwarePlatform.getHardwarePlatformInfo((info)=>
{
$('#info').append("<b>Model: " + info + "<br><hr>");
});

}

document.addEventListener('DOMContentLoaded', function () {
    populateDeviceInfo();
});



Simeon Vincent

unread,
May 29, 2020, 3:43:57 AM5/29/20
to Matthew Nichols, Chromium Extensions
Please file a bug report on crbug.com

Cheers,

Simeon - @dotproto
Extensions Developer Advocate


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/7fc044d8-8164-4914-9718-1d10b59e4705%40chromium.org.

David

unread,
May 29, 2022, 9:49:25 AM5/29/22
to Chromium Extensions, Simeon Vincent, Chromium Extensions, Matthew Nichols
Hi Simeon, Matthew

Just to make sure - was that bug fixed?
Does it work on Windows / Mac as well?

David

David

unread,
Jun 16, 2022, 10:59:58 AM6/16/22
to Chromium Extensions, David, Simeon Vincent, Chromium Extensions, Matthew Nichols
Hi guys, pinging again.

Does this API works (/partially works) in windows / macOS?

Cheers,
David
Reply all
Reply to author
Forward
0 new messages