graham o'donnel
graham o'donnel

Reputation: 395

How can I detect which version of webOS is running on a TV

I need to patch a functionality just for webOS 1.x.

Which would be the better approach? I'm not sure about the user agent in old versions, and Luna service is unreliable on webOS 1.0.

Upvotes: 0

Views: 1302

Answers (1)

graham o'donnel
graham o'donnel

Reputation: 395

Finally I've managed using luna. Here is the snippet:

var lunaReq= webOS.service.request("luna://com.webos.service.tv.systemproperty",{
method:"getSystemInfo",
parameters:{
"keys": ["modelName", "firmwareVersion", "UHD", "sdkVersion"]
},
onSuccess: function (args) {
console.log("sdkVersion: ", args.sdkVersion);
//for 3.3: sdkVersion:  3.3.0
//for 2.: sdkVersion:  2.2.0
}
},
onFailure: function (args) {
console.log("Error calling LUNA service");
}
});

luna service can give problems on first webos versions, but user agent is completly inconsistent. I found all kind of user agents for webOS 1.x:

Mozilla/5.0 (webOS/1.3; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Desktop/1.0

Mozilla/5.0 (webOS/1.3; U; en-US) AppleWebKit/538.39.41 (KHTML, like Gecko) Version/1.0 Safari/538.39.41 Desktop/1.0

Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.41 (KHTML, like Gecko) Large Screen WebAppManager Safari/537.41

Cheers!

Upvotes: 1

Related Questions