我希望在通过 HTMLService 显示 Web 应用程序的同时,在 Apps Scripts 中获取当前浏览器窗口的完整 URL
当我尝试这个时,它不起作用,因为 Apps Scripts 是沙盒的,我得到了某种类型的另一个服务器 url
window.location.href
Run Code Online (Sandbox Code Playgroud)
当我尝试这个时,我只能获取哈希或参数,而不是完整的 url
google.script.url.getLocation(function(location) {
console.log(location.parameters);
console.log(location.hash);
});
Run Code Online (Sandbox Code Playgroud)
来源:https : //developers.google.com/apps-script/guides/html/reference/url#methods
上述目的:我想要一个人们在已发布的 Web 应用程序中单击以删除浏览器工具栏的按钮。但是,浏览器工具栏在当前浏览器窗口中是不可移动的。因此,我想获取 Web App URL 并将其作为当前 Web 应用程序的新窗口放入 window.open() 中,因为可以通过这种方式删除浏览器工具栏。但我似乎无法获得当前的 URL。
我有什么想法可以实现这一目标吗?
提前致谢!
很抱歉,如果这是一个愚蠢的问题,但我是JavaScript/Node.js的新手.下面这段代码使我无法完成我的研究......我的下面的问题更具体地与实例化有关.
我不明白这个:
var myApp = require('express');
var myCode = myApp();
Run Code Online (Sandbox Code Playgroud)
我怎么看它应该用于实例化:
var myApp = new Express();
var myCode = myApp.insideExpress();
Run Code Online (Sandbox Code Playgroud)
匿名函数表达式如何:
var myApp = function();
var myCode = myApp();
Run Code Online (Sandbox Code Playgroud)
如果单词" require "作为一种匿名函数表达式,那么事物如何在后台实例化?这对于制作合适的图案非常重要,不是吗?
我的问题是:
提前致谢