Github onebox broken for some link types

Discourse has really great preview cards for links in general, dropping in a link on a new line (onebox previews).

Recently I’ve found, though, that Github repository links no longer have any previews (I think they had before), while linking to a specific file on Github has. For example posting

^^ this has no preview (at the time of posting)

But posting a link to a file in the repo, e.g.

^^ this has proper preview

I know it worked before, because in our Discourse the first link works, looking like this screenshot:

I suspect it has to do with Github’s recent style changes (as that happened less than a week ago, and the working screenshot is from 14 days ago).

I also think that besides broken repo links, organization links also regressed, but don’t have a previous working example at hand to double-check.

Any thoughts?

1 Like

As usual, try it on and see what you get. Remember oneboxes require proper OpenGraph or oEmbed support.

If it worked before, and you’re on the same version of Discourse, then maybe something did change on their end.


Since we are on hosted Discourse (on Discourse), I can’t really tell whether the version is the same or not. :confused:

Trying iframely with the first link (the one that doesn’t have any preview anymore) and the second (that still has) gives the same exact result, extracting info seemingly correctly.

You mean on Github’s? They seem to have updated their design (styling) as mentioned above, so that might cause issues extracting stuff, but iframely seems to say that at least the part they test for works? (even though I’m not sure if the extracted text/icons are the same as they were presented in the onebox before, or how the iframely test really compares to what the onebox should show)

I’m also seeing problems:


Watching the Dev Tools Network Tab, onebox is returning a 404 for the given URL, it seems this isn’t the only URL it is doing that for either.

Does it for the Official Discourse Repo too, the issue is with onebox

Network Tools info:

General: (user_id and ip removed intentionally)

Request URL:
Request Method:GET
Status Code:404 
Remote Address: snipped

Query Parameters:


Edit: Looking at this again, I think GitHub broke this. I could have sworn they used to provide og/oembed tags on the Repo landing page, but now it is definitely not there.


It seems to me, that it might be more complicated than that…

For example take a specific file from a repo: discourse/ at master · discourse/discourse · GitHub The iframely link says no embed code: but then Discourse itself / onebox happily embeds it:

If iframely was correct, then neither the repo link, nor the file link would work. But one does and the other doesn’t…

Gists have special support and have for a long time. There is generic oembed / opengraph and hard coded special support. Two different things.