Google Apps iFrame上弃用getCurrentPosition? [英] getCurrentPosition deprecated on Google Apps iFrame?

查看:130
本文介绍了Google Apps iFrame上弃用getCurrentPosition?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Google Apps脚本上的HTML模板运行Google地图。
这意味着整个Web应用程序都存在于使用以下内容创建的iFrame中:

  function doGet(e){var template = HtmlService.createTemplateFromFile('index.html'); template.action = ScriptApp.getService()。getUrl();返回template.evaluate()。setTitle('Google Map on Apps Script').setFaviconUrl('https://developers.google.com/_static/907a9d4ef3/images/favicon.png').setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL );}  



以前从来没有这个问题,但现在getCurrentPosition是即将被禁用的不包含allow =geolocation属性的iFrame。



有谁知道如何将此属性添加到使用Google Apps脚本HTMLService?有没有类似于.setXFrameOptionsMode的东西?我在这里错过了什么?



https://sites.google.com /a/chromium.org/dev/Home/chromium-security/deprecating-permissions-in-cross-origin-iframes#TOC-To-continue-to-use-permissions-from-iframes-on-your-website ...

解决方案

应用脚本支持博客
您可以为它投票。


I'm running a Google Map through an HTML template on Google Apps Script. This means that the entire web app exists within an iFrame created with the following:

function doGet(e) {
  var template = HtmlService.createTemplateFromFile('index.html');
  template.action = ScriptApp.getService().getUrl();
  return template.evaluate().setTitle('Google Map on Apps Script').setFaviconUrl('https://developers.google.com/_static/907a9d4ef3/images/favicon.png').setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
}

This was never an issue before but now getCurrentPosition is about to be disabled for iFrames that don't include the allow="geolocation" attribute.

Does anyone know of a way to add this attribute to an iFrame created with the Google Apps Script HTMLService? Is there perhaps something similar to .setXFrameOptionsMode? What am I missing here?

https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-permissions-in-cross-origin-iframes#TOC-To-continue-to-use-permissions-from-iframes-on-your-website...

解决方案

This new feature requested in the apps script support blog. You can vote for it.

这篇关于Google Apps iFrame上弃用getCurrentPosition?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆