Onebox not working

frc-docs is in the process of adding Open Graph support. When I tried the test site (link below), it did not generate a Onebox. Is there a setting to only enable Oneboxes on certain sites? It does work on other sites that support Open Graph.

It has description set, which per below is the the only thing needed for Onebox to work.

1 Like

Looking at this:,
it appears that domains have to be whitelisted.

I think it needs to be added to whitelisted_generic_onebox.rb:

It would suggest adding


I’ve added these 3 … let me know if it works or needs updating.


Could you try adding
And, could you add a second copy with https:// prepended? ->

I found discourse specific info: Quickly explain what Onebox is? - feature - Discourse Meta

Does it need https:// for all of the previous three urls too?
curl on is rejected but works on

Looking through the source code in the above posted github link, they seem to handle urls that need to change http to https differently

I added them in with https also, no dice. Not sure, without digging in further, why it’s not showing. Found some more discussion about it not working on every site, here:

I just got openbox with wpilib docs working on a local Discourse instance. Now I just have to figure out why and how.

Ok. I think I’ve cracked it.

First, testing woes:

Discourse caches onebox requests for 24 hours so trying the same url doesn’t work. So to test, urls have to be appended with garbage/unique query strings. (https://url.html?q=anger, https://url.html?q=entireminuteswasted, …)

The frc docs issue:

If the requested page contains a <link rel="canonical" ...>, then Onebox uses that and ignores the actual url that was passed in. The frc docs canonical points to the stable version of the docs; The opengraph data only exists in the latest version. So, onebox never sees the opengraph data.


Fix 1

Once the opengraph version of frc docs makes its way from latest to stable, it should work.

Fix 2

Onebox ran into this same issue with instagram.

So, they have an override for this.

In the onebox gem’s lib/onebox/helpers.rb, IGNORE_CANONICAL_DOMAINS (line 8 ish) should change from:



1 Like

I’d like to avoid editing any of the core code (or libraries).

If you wanted to write a Discourse plugin to modify this behavior I would consider installing. (Or submit a pull request to onebox on github to add to their code)


I had started to work on the plugin but onebox looks for an undocumented html property that ignores the canonical url.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.