var html = HtmlService.createHtmlOutputFromFile(‘top’).setWidth(700)‘Top’ is a html page with iframe which hosts the URL. This modal dialog appears properly when user click on a button in HTML page / card interface page hosted on the sidebar of the add-on. This works fine when ‘Allow all cookies’ is enabled.The exception occurs only when user set ‘Block Third-Party cookies’ in chrome browser cookie settings. After disabling Third-Party cookies, when user click on button in the sidebar, dialog appears and it couldn’t render the page and throws security exception.I see the below local storage security exception in console logs of the browser.
.setHeight(620).setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
DocumentApp.getUi().showModalDialog(html, “My Page”);