Embedding Google Apps Script WebApp in WordPress Page

最后都变了- 提交于 2019-12-01 11:21:22

问题


I've done a great deal of research on how to workaround Wordpress's iframe restrictions and I've been able to get it to work using various plugins with common services (google maps, youtube, etc.). However, all of these methods have not worked for embedding one of my published webApps. My most recent efforts have been using this plugin.

Here is an extremely simple 'Hello World' webApp that I would like to embed: LINK.

I was unable to simply use that URL as the 'src' for the iframe so I embedded the webApp in this google site then viewed the source of that iframe which I found to be:

<iframe src="https://sites.google.com/macros/s/AKfycbyAFo9aWOUw3FxiVZTGad6sgpcIbxZm1g9dS0yujV0tOBAI3582/exec?authuser=0&amp;mid=ACjPJvEpRFnQA1LHa7qtEGta-zgj2r8oi_E2l-BUfSFUNBlxmagk2TXEd6msYIW1i7b4lfPTkEc9dZLm795dplLiaH7LZ3GchmiVtMYyXnBeeGhQ-NfS8a7-2n7NKzqPFibZ1fqr&amp;bc=transparent&amp;f=Georgia,+Times+New+Roman,+serif&amp;tc=%23333333&amp;lc=%230036b3" title="Apps Script Gadget" width="150" height="100" frameborder="0" scrolling="no" id="maestro_frame_1429669030"></iframe>

I then used that iframe code within the plugin's shortcode on the wordpress page and nothing is shown when published. The frame seems to be there but it's completely blank. When I try to view the frame source - it's blank. Please help?

I'm open to other ways to do this. I just need to somehow embed my published GAS webApps.


回答1:


To save others digging for this answer, it is possible by using setXFrameOptionsMode:

https://developers.google.com/apps-script/reference/html/html-output#setxframeoptionsmodemode




回答2:


The Inline Google Spreadsheet Viewer, despite the name, is a plugin for WordPress that can embed the output of any public Google Apps Script Web App without an iframe.




回答3:


The Inline Google Spreadsheet Viewer doesn't work for Webapp. I think the only way to communicate with google app script from your own website is to use this solution :

https://www.youtube.com/watch?v=JRGzVdliQOQ

Take a look at this discussion :

https://code.google.com/p/google-apps-script-issues/issues/detail?id=852

App Script HTMLService App in iFrame



来源:https://stackoverflow.com/questions/17350485/embedding-google-apps-script-webapp-in-wordpress-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!