question

KeesJanHoogland-9268 avatar image
0 Votes"
KeesJanHoogland-9268 asked RickKirkham-9346 commented

Protect javascript source code for Word addin

Dear community,

We have developed a Word addin in javascript.
All the code for this addin is executed on the client side, no calls are made to a back-end server.
The problem is that all the code is visible by using the 'Attach debugger' option in the sidebar in which the front-end of the addin is shown.
The question: Is it possible to disable this debug option or hide the javascript code in any other way? or is the only way to achieve this to move all the business logic to a back-end server?




office-addins-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RickKirkham-9346 avatar image
1 Vote"
RickKirkham-9346 answered RickKirkham-9346 commented

There is no way to hide JavaScript in web apps in general, so you can't hide it in add-ins either. The best you can do is use an obfuscator/minifier tool to make the code difficult for a human to read.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you RickKirkham-9346. I was afraid of that and hoped that Microsoft would offer a protected browser within Word.
We already minify and obfuscate the code, but even then a user can still copy the code and use the addin without a license.
Is the only way to avoid this to move a part of the business logic to the back-end?

0 Votes 0 ·

Yes. as I understand it, code that you want to absolutely protect cannot be in client side JavaScript.

0 Votes 0 ·