Protecting Processing.js source

828 Views Asked by At

Is there anyway to protect Processing.js sketch?

My company has a sketch that he wants to show to the world and in the mean time, he wants to ensure that no one can see his source code.

I've done protecting (partially) my javascript from browsers but the problem that I'm facing now is that firebug could reveal (XHR) my partially, protected source code.

So, I was wondering if I could obfuscate my source code. But would doing that cause processing.js to stop interpreting my source?

Is there anyway that I can use to protect my sketches?

3

There are 3 best solutions below

1
On

No, obfuscation won't break your source code. Everything should work fine, just like when using normal source code.

Have you thought about doing it some other way? For example, after making a sketch, why not convert it to SVG or some other image format and show that instead to the world?

1
On

You can generate the sketch data on the server and upload it via ajax, sending most of the processed result directly to the browser. But there will always be some readable code.

It's not in javascript nature to be hide itself.

0
On

File a bug with us on dealing with your obfuscated code, it should parse fine:

http://processing-js.lighthouseapp.com/projects/41284-processingjs/overview