tophee is looking for a way to embed a Google Books preview into Discourse. Google Books offers a plain link and an iframe, but neither works out of the box. tophee considers using the whitelist-iframe plugin to whitelist google.books.com.
dax suggests looking at the integration on discussbook.com and its source code, which uses JavaScript and the Google Books API library. tophee is interested in this approach, but notes that the previews don’t work.
tophee successfully uses the whitelist-iframe plugin to embed Google Books previews. Shortly after, dax announces the release of the Google Books Plugin for Discourse integration.
tophee reveals that they had customizations made for the plugin, indicating a potential solution for embedding Google Books previews in Discourse.
Take a look here https://discussbook.com/ and here view-source:https://discussbook.com/assets/plugin-third-party-6ae2c6dcefb0b7bf8b18b7b7f6c91a8882c9cde5f35e429cf3c2cb85fe77e855.js .
That books integration looks fascinating (though the previews don’t seem to work, I just get an empty lightbox). What I had in mind was oneboxing the preview, but this might also work (when it works), maybe even better.
I will have to look into that source code later to see what in those 1383 lines is relevant here (I am not a programmer).
Are you saying that the whole integration is done only via JS, no discourse plugin?
I have successfully added google books to the iframe whitelist using the whitelist-iframe plugin. and it works just perfectly when pasting the iframe code that google books provides by default.