Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There is no way to completely prevent JavaScript code from being displayed in the console using Google Apps Script (GAS), as the code is executed on the client side and the client has full access to the code. However, here are some ways to obfuscate the code and make it more difficult to read:

  1. Use a minifier: A minifier is a tool that removes unnecessary characters and shortens variable names, making the code harder to read.

  2. Use an obfuscator: An obfuscator is a tool that renames the variables and functions in the code to obscure their purpose and make it harder to read.

  3. Split the code into multiple files: By splitting the code into multiple files and using server-side code to concatenate the files, the code will be harder to read in the console.

  4. Use encryption: You could encrypt the code using a cipher or other encryption method, then use server-side code to decrypt it before executing it in the browser. This method is more secure, but also more complex to implement.