SketchUp / api-issue-tracker

Public issue tracker for the SketchUp and LayOut's APIs
https://developer.sketchup.com/
39 stars 10 forks source link

UI::WebDialog navigator.userAgent doesn't report "SketchUp" Since 23.x #984

Open thomthom opened 3 months ago

thomthom commented 3 months ago
html = '
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta http-equiv="MSThemeCompatible" content="Yes">
</head>
<script>

function hello() {
  alert("hello")
  window.location="skp:helloWorld@Thom";
  alert("world")
}

</script>
<body>

<button type="button" onclick="window.location=skp:helloWorld@Thom">Hello</button>
<button type="button" onclick="hello()">Test</button>
<button type="button" onclick="alert(navigator.userAgent)">Hi</button>

</body>
</html>
'

@wd = UI::WebDialog.new
@wd.set_html(html)
@wd.add_action_callback('helloWorld') { |dialog, params|
  puts 'helloWorld'
  p params
}
@wd.show

@wd.execute_script('window.location = "skp:helloWorld@hi"')

Not sure if this regressions happened with SU2023.0 or one of the minor updates. But it's still broken in SU2024.0

sketchup[bot] commented 3 months ago

Logged as: SKEXT-4229