Embeddable Shopfronts - Whitelabelling

That looks good. The main blocker at the moment is a simple change in Rails settings to allow pages to be embedded in iframes, outlined here: https://jerodsanto.net/2013/12/rails-4-let-specific-actions-be-embedded-as-iframes/

It’s one line of code: response.headers.delete "X-Frame-Options", which needs to be added on the before render action of whichever controller actions we want to make embeddable.

It’d be good if we could get something like this pushed and merged relatively quickly, because I can’t even test an iframe or tinker with it at the moment. Everything else isn’t really urgent but obviously would be nice to have at some point.

So after a brief chat the outline is:

  • An admin checkbox for “enable embedded shopfronts”
  • A general helper method (enable_iframes) that checks the admin setting is enabled, then unblocks iframe use with the line of code above
  • The method gets called selectively on the necessary controller actions using :after_filter
1 Like