如何保护Google电子表格中的Apps脚本代码? [英] How to protect the Apps Script code in a Google spreadsheet?

查看:110
本文介绍了如何保护Google电子表格中的Apps脚本代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用脚本编辑器为我的Google电子表格编写了一些代码。



我想与客户共享此电子表格,但我不想分享代码我写了。



此代码向我的电子表格中添加一个菜单,其中包含有用的功能,当我的客户打开此电子表格时,应用程序会运行/运行,条件是:它们应该无法看到它的代码。



这很容易使用Excel,但使用Google电子表格我不知道。 。我在Google上搜索了很多,但他们都提供了关于如何共享电子表格的想法。例如在查看模式下,但在这种情况下,存在一个问题:添加菜单的菜单功能是onOpen,并且在客户端打开它时不会启动。



如何在Google Spreadsheet中执行此操作?

解决方案

简答



将您的脚本发布为附加组件。请注意,您可以将其设为不公开,并与Google群组共享。



说明



附加组件这比使用图书馆要好,因为您的加载项没有任何内容。



即使您的插件用户能够获得Google Apps脚本项目的URL来自你的插件的crx文件,因为它不会被共享,他们将无法访问代码。



请注意,这是不可能的使用Chrome Developer Tools或其他类似软件访问Google Apps Script服务器端代码。

b $ b
  • 发布后从我的Google电子表格插件中获取代码

  • Google Apps脚本附加组件源代码/安全性

  • 建立一个Google文档和表格的dd-ons


  • I have written some code for my Google spreadsheet with the script editor.

    I want to share this spreadsheet with my clients but I don't want to share the code I have written.

    This code adds a menu to my spreadsheet which contains useful functions that should work/run when my clients open this spreadsheet with condition applied that: they shouldn't be able to see its code.

    This is easy with Excel, but with Google spreadsheet I don't know. . I have searched a lot on Google but they all gives the idea about how to share a spreadsheet. For example in "View" mode, but in that case there is a problem: my menu function, which adds a menu, is "onOpen" and doesn't start when my clients open it.

    How to implement this in Google Spreadsheet?

    解决方案

    Short Answer

    Publish your script as an add-on. Bear in mind that you could make it private, shared with a Google Group.

    Explanation

    Add-ons were added on 2014. This is better than using a library because there will be nothing from your add-on.

    Even if your addon users are able to get the Google Apps Script project URL from the crx file from your addon, as it will not be shared, they will not be able to access the code.

    Please note that it's not possible to access Google Apps Script server-side code by using Chrome Developer Tools or another similar software.

    References

    这篇关于如何保护Google电子表格中的Apps脚本代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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