Saptarshi recently posted a Google doc link and it wasn’t working. I’m making this post to test out Google Doc links in Discourse.
Strange. Just a blank space in place of the link.
Hey @michael, any chance we could get the Google docs Onebox for Discourse plugin installed?
https://meta.discourse.org/t/google-docs-onebox-for-discourse/26247/14
I was looking at that bug (it’s supposed to be in the general onebox gem no longer a plugin) yesterday and it is on my plate, but my plate continues to get fuller by the day.
What happens if I link to a document that is publicly viewable? Will I get the “Load denied by X-Frame-Options: (URL) does not permit cross-origin framing” error?
https://docs.google.com/document/d/1IQGdx-1X-E_W3O5PSiV9RF1hhjI5hryWZF9FFYNv4Oc/pub
UPDATE: It turns out that the Google document must be “published” rather than just “shared” publicly. You can do this in Google Docs UI by choosing “File” --> “Publish to the web”.
It works! Nice find!
The onebox gem could be improved if it would display a message if the content cannot be rendered. Something like:
This Google document must be published to the web before it can be embedded:
- Open the document on Google Drive
- In the menu, choose
File
→Publish to the web...
Agreed an error message would be helpful. (Or at least something besides blank space.) I suggested the same to one of the developers who have worked on the gem, and hopefully they may be able to figure out a way to do that.