问题描述
我们可以将google app脚本代码发布到chrome扩展工具中吗?到目前为止,我们已经从app-script开发了一个Web应用程序,它可以作为Web应用程序使用.从Google应用程序脚本编辑器将其转换为chrome扩展程序需要做什么.分享宝贵的建议表示赞赏.
Can we publish google app-script code in to a chrome extension tool. So far we developed a web app from app-script, which is working as a web application. What need to be done to convert it in to a chrome extension from google app-script Editor. Appreciations are shared for valuable suggestions.
推荐答案
我已经开发了GAS Web Apps和Chrome扩展程序,可以肯定地说您不能使用Google Apps Script的GUI编辑器来开发Chrome扩展程序.它们是两种截然不同的野兽.
I've developed both GAS Web Apps and Chrome Extensions and I can say with certainty that you cannot use Google Apps Script's GUI editor to develop a Chrome extension. They are two very different beasts.
例如,Google Apps脚本使用其自己的服务器端javascript语言.此外,它还利用了其平台独有的库和服务.
For one, Google Apps Script, uses its own flavor of server-side javascript. Plus it leverages libraries and services unique to its platform.
Chrome扩展程序使用客户端javascript,它也具有自己的库和服务.
A Chrome extension uses client-side javascript and it too has its own libraries and services.
此外,它们对用户身份验证的处理方式略有不同(即使他们在后台利用了相同的OAuth2流).
Moreover, they handle user authentication a bit differently (even though they are leveraging the same OAuth2 flows under the hood).
但是您可能可以将两者整合在一起.您应该能够从Chrome扩展程序向Web应用发出POST请求,因此这是一种方法.
But you might be able to integrate the two. You should be able to make POST requests to a Web App from a Chrome Extension, so that's one approach.
但是,GAS脚本受到配额限制的限制,因此您最好从头开始重新构建应用程序,使其成为一个独立的Chrome扩展程序(我认为是更好的选择).
However GAS scripts are limited by quota restrictions so you might be better off rebuilding your app from the ground up as a self-contained Chrome Extension (the better option in my opinion).
这篇关于我可以使用Google App脚本开发Google Chrome扩展程序吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!