Doesn't work - Cross-domain Redirect in google form in an iframe in google sheets app script -
i have function launchform within google sheet calls function createform single question. url of newly created form , pass sandbox iframe using urlfetchapp, shown below:
function launchform() { var form = createform(); // separate function works fine formurl = form.getpublishedurl() var response = urlfetchapp.fetch(formurl,{"followredirects" : true}); // true if automatic redirecting works var formhtml = response.getcontenttext(); var htmlapp = htmlservice .createhtmloutput(formhtml) .setsandboxmode(htmlservice.sandboxmode.iframe) .setxframeoptionsmode(htmlservice.xframeoptionsmode.allowall) // did prevent error didn't var ss = spreadsheetapp.getactivespreadsheet(); ss.show(htmlapp); } i have created custom menu in sheets run launchform function.
the trouble is, new form url @ docs.google.com/a/, while sheet @ docs.google.com/spreadsheets/d/...
this means iframe, instead of loading form, opens sign-in screen in when (the creator of form) tries run it. when else edit permissions runs script, sees form expected, unable make inputs form.
i have read cors, x-frame-options, oauth2, , nothing seems provide precise answer must do. appreciated.
Comments
Post a Comment