HtmlService.getUserAgent() is not available in V8 runtime of GAS

Asked 3 months ago, Updated 3 months ago, 10 views

V8 runtime is now available on the GAS.

However, when calling the HtmlService.getUserAgent() function, the legacy Rhino engine returned browser information in use, but the V8 engine seems to return null.
Is there any way to fix or avoid this?

function baz(){

If you run the above code on the Rhino engine, V8 will display "null".

javascript google-apps-script ecmascript-6

2022-09-30 11:18

1 Answers

I don't know if it's a good thing, but I also asked questions in the English version and saw a temporary solution.

The summary was that the V8 did not seem to be able to use GAS's HtmlService.getUserAgent() yet, instead using the Navigator interface in client-side JavaScript.

It also worked on GAS WebApps to achieve its goal.

Also, I received a comment on Google's IssueTracker saying that I should vote, and I also voted for it.

That's all.

2022-09-30 11:18

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.