No SketchUp identity info in User-Agent while using Webdailog to access a web URL in SU2023

Hello everyone,

I noticed that in SketchUp 2023, the User-Agent string no longer contains identifying information when making requests via the SketchUp WebDialog.

In previous SketchUp versions, the User-Agent clearly indicated that the request originated from a SketchUp WebDialog. However, this identity information is missing in SU2023.

My question is: does anyone know how to add custom headers to requests made by the WebDialog in SU2023? It would be helpful for our server-side code to distinguish if a request came from a SketchUp WebDialog.

I would appreciate any insights or suggestions on how to approach this in SU2023. Thank you all in advance for your comments!

PS: it is not an issue while using HTMLDialog, but in my case, i need to use Webdailog

Best regards,

Could it be because of it’s deprecated?

1 Like

could be… any idea to walkaround ?

I haven’t use Webdialogs since they are obsolete, I would try to switch to html

The two dialog classes in UI module do not have Ruby API methods for specifically setting headers.

You can make separate requests via Sketchup::Http::Request from v2017 onward.

Or … you could set a header field using the http-equiv type of meta element.

And you could add custom meta elements also using the name type of meta element.

        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="client" content="SketchUp">

On the server side access the collection via JavaScript …

var meta_tags = document.getElementsByTagName("META");

… then iterate the collection looking for property type “name” and content containing "SketchUp".

Another idea (untested) if the webpage is a client-side extension webpage

        <meta http-equiv="content-type" content="text/html; charset=utf-8">
            var sUserAgent = navigator.userAgent;
            if ( sUserAgent.indexOf("SketchUp") < 0 ) { // not found
                var ua = document.createElement("meta");
       = "User-Agent";
                // Append SketchUp client info:
                ua.content = sUserAgent.concat(", SketchUp");


You can set headers for XMLHttpRequest, otherwise, maybe use a query parameter in the URI?

Sorry, I assumed you meant that you were using script in the dialog to retrieve a URI. If you’re using dlg.set_url '<uri>' then opening the page, I don’t believe you can do anything with the request headers.

And, yes, you’re correct about User-Agent in SU2023. I tried SU2017, SU2020, and SU2022, and they all have ‘SketchUp’ in the User-Agent string.

Just to clarify for others, this question is about the HTTP request sent to the server. HTML is often returned in the HTTP response from the server, as it’s the format understood by browsers. Note that HTML is considered the content (or body) of the response. The response contains additional information (status, headers, etc) that one can see in ‘dev tools’. This information is not rendered by the browser.

and above where I speak about <meta http-equiv ...> elements, they affect response headers, not request headers.

It is not clear to us whether the webpage displayed in the dialog is generated on the client-side or the server-side.

The “aim” of course is for the server to able to know, regardless of how the webpage is generated, whether or not the page is displayed within a SketchUp dialog window.

We also do not know what SketchUp versions are being targeted.

If the version is pre-2017, I would think the only solution is to use a specific URL (or subdomain or query parameters) for SketchUp dialogs. Any browser outside SketchUp would not (or should not) use this means of connecting to the server.