Google docs onebox gem requires a "published" document

Embedding a Google document via the onebox gem seems to be broken. All that displays is a blank placeholder. When trying new posts, I get the following error in the console:

Load denied by X-Frame-Options: (Google Doc URL) does not permit cross-origin framing.

I’ll paste the URL of a sample document,, in a line by itself here:


Added on my list. :pencil:


Michael, are you sure you published the Google Doc you are trying to onebox?

Google Doc needs to be published (not shared) for embedding. More info here.

In my testing the published Google Doc is getting embedded.


Can we convert the URLs into the publish form automatically?

May want to build on top of so we don’t get iframe flashing.

I don’t think so. I believe only the document owner has the rights to publish that document.

Simply appending /pub at the end of the URL will not allow embedding of that document.

:+1: That worked. Thanks for the insight!

That said, I don’t know that people would automatically think to do this. Is there any way to get around the limitation so that a “share” works? Alternatively, is it possible to display some type of useful error message rather than just empty space?


Good point. I’ll see what I can do, added on my list.

1 Like

Best solution would IMHO be to just disable the onebox for docs that were only shared and not published, not sure how to detect this. But I noticed that for documents I share all URL paths end with /edit, e.g. justtesting - Google Docs, while the published URL ends with /pub, e.g. justtesting

Another issue with the Google Docs Onebox is that they do not provide any link to the actual document, which often would make viewing easier instead of only relying on the embedded version.


In my community, we post a lot of Google Docs & Sheets that have been shared but not published. According to this topic, this results in a broken onebox.

Until there’s a better solution, I would like to disable oneboxes for Google Docs. Is this possible?

I’m not aware of any way to disable it.

1 Like

In this case, I’d like to request a setting to blacklist domains – the inverse of this:

(I’m not entirely sure if there’s a formal way of initiating feature requests, short of becoming a paying customer. I just type here and hope for the best.)


Apologies for repeating myself, but I’m getting quite a bit of flak about this from my community. The Google Docs onebox is kind of half-baked and I would very much like to be able to turn it off.

The only workaround I’ve found is to run the link along with the previous paragraph of text. (I.e., not putting it on a line of its own.) I found this by trial and error and I’m pretty techie. It’s not really feasible to instruct users We refer to Google Docs a lot, and I’ve gotten into the habit of editing people’s posts in this manner to prevent the onebox from appearing.

In any case, I think embedding the document is overkill and should be optional. I much prefer Slack’s approach:

An attractive link is sufficient. It’s a spreadsheet, after all. I’m not going to try and view it in a tiny window.


Just put a space in front of the link. Not sure how that’s too “techie” of a workaround, for now…

1 Like

Ah, the space is useful as well for me. I meant “techie” in the sense that my users (mostly academics and higher ed staff) generally don’t actively look for ways to thwart their technology. If they don’t like how something works they just put up with it and/or complain :smiley:

1 Like

I agree with this @techAPJ

Can you add that to your list? Embedding a full Google spreadsheet, doc, etc is kind of insane when you think about it…


Yeah, if anything it should be optional, opt-in. I would hold off for 1.7 though and just have it use the generic default onebox support (after mini onebox is built)


Okay, this is now done.






When the doc is not public, the title and contents can’t be pulled in by the onebox, so the click target is a lot less obvious. Here’s a screenshot of an example:

Perhaps that “title” should be rendered in bold blue text as “Google Sheets” or “Google Docs” or “Google Slides” when the title content can’t be retrieved?



Yes, good point! I’ll make it so.


While you’re at it, would it be possible to make the large icon clickable as well?