Google Apps Script と
作った
新しいGoogle Site とは
新しいGoogle Site は、
旧Google Site に
旧Google
Google Site の
Google SIte site:https://gsuiteupdates-ja.googleblog.com - Google 検索
ガジェットとは
旧Google Site には、
以下、
XMLを
新しいGoogle Site には、Gadgets API
をウェブからの<wbr>埋め込み
機能を
ウェブからの<wbr>埋め込み
機能の
* 新しいGoogle Sitesを
作成した ガジェットの 説明
指定した Qiita の
Githubリポジトリ
以下に、
コンテナバインドスクリプト
Google スプレッドシートに
コンテナバインドスクリプトは、
gas-GSiteRSSWidgets/gas at master · kemsakurai/gas-GSiteRSSWidgets
main.gs
スプレッドシートの操作を する JavaScript関数を 定義しています。 init
スプレッドシートの初期化を します。 rssシートを 作成します。 inputRSSURL
取得対象のRSS URLを スクリプトプロパティに 記録します。 parse
スクリプトプロパティに記録した RSS URL から RSS Feed を 取得し、 取得結果を rssシートに 記録します。
doGet.gs
Web公開時に、リクエストを 受け付ける doGet関数を 定義しています。
callbackクエリストリング指定時は、JSONP形式で レスポンスを 返し、 それ以外の 場合は、 HTMLで リクエストを 返します。
組み込みHTML
HTMLは、
gas-GSiteRSSWidgets/embeddedHTML at master · kemsakurai/gas-GSiteRSSWidgets
組み
Google Apps Script の
Google Apps Script の HTML を ガジェットと して 組み込む 場合の 注意点
headタグ内の、 baseタグの 指定は、_blank
に する。
Google Apps Script の_top
を
Unsafe JavaScript attempt to initiate navigation for frame with origin 'https://sites.google.com' from frame with URL 'https://n-v2ed4jydgl4r6zlpgb7swjjzlwha1c123cd3yma-0lu-script.googleusercontent.com/userCodeAppPanel'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set.
_blank
指定だと組み込みHTML内での 外部API呼び 出しは JSONP形式で 行う
JSON形式の
Access to fetch at 'https://tetsudo.rti-giken.jp/free/delay.json' from origin 'https://996619499-atari-embeds.googleusercontent.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'null' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
使い方の イメージ
個人的には、
Qiita の
参考
以下、
HTML Service: Templated HTML | Apps Script | Google Developers
Migrating to IFRAME Sandbox Mode | Apps Script | Google Developers
以上です。
コメント