Javascript Embedding Discourse Comments - User Agent

Hi

We are looking at embedding comments to pages on our website using the Embed JS feature (which looks awesome).

We have just run into a little issue and its similar to this:

We use prerender to server side render pages for certain user agents e.g. Google. We have added detection for 'Onebox which works great. However we need something similar for when the Embed scrapes the page.

I have tried to find the user agent sent but I haven’t managed to find it. Can anyone tell me what it is?

Took a guess and it looks like the User Agent is ‘Ruby’.

That is odd, I am pretty sure onebox sends its own user agent. I know that because WPEngine loves to block all unknown user agents and we have to sometimes ask for the oneboxer user agent to be specifically whitelisted to onebox WP sites they host. Cc @techAPJ

Onebox uses its own user agent. I think @Jono_Brain2 is describing the “topic embed” scraper which pulls in content like this

It doesn’t specify a user agent, so it uses the default Ruby agent

3 Likes

Thats exactly it. Onebox has its own user agent, but the embeddable comments uses default Ruby user agent.

2 Likes