Home > Blockchain >  How to get Operating System version and name in Google App Script?
How to get Operating System version and name in Google App Script?

Time:03-09

I am currently developing a GMail addon and it requires some Operating System related information. The kind of information we get when we run 'Navigator.UserAgent'

I can determine some/partial data using the event parameter 'clientPlatform'. But it does not have the more verbose information found in Navigator.UserAgent.

I also tried HtmlService.getUserAgent() but it returned null.

Is there a way to get 'userAgent'-like properties from Google Apps Scripts?

CodePudding user response:

From https://developers.google.com/apps-script/reference/html/html-service#getuseragent

getUserAgent()

Gets the user-agent string for the current browser. Returns null for most script executions if not used in a web app's doGet() or doPost() function.

In other words, it's not possible on Gmail-Addons only on Web Apps.

  • Related