相較於其他沙箱模式,IFRAME 模式施加的限制較少,且無法執行
較快,但在某些舊版瀏覽器上無法運作,包括 Internet Explorer 9。
您也可以檢查 google.script.sandbox.mode,在用戶端指令碼中讀取沙箱模式。請注意,這個屬性會在用戶端傳回實際模式,
如果無法在
使用者的瀏覽器設定。
<!-- Read the sandbox mode (in a client-side script). -->
<script>
alert(google.script.sandbox.mode);
</script>
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-08-21 (世界標準時間)。"],[[["SandboxMode is used for setting the sandbox environment for client-side HtmlService scripts in Google Apps Script."],["`IFRAME` is the only supported SandboxMode; `NATIVE` and `EMULATED` are deprecated and sunset."],["Client-side code in HTML service runs in a security sandbox with restrictions to protect users."],["`IFRAME` mode has fewer restrictions and runs faster but might not work in older browsers like Internet Explorer 9."],["You can read the actual sandbox mode on the client-side using `google.script.sandbox.mode`."]]],[]]