Jump to content

Prevent the user from viewing the js file


freelance84

Recommended Posts

I was wondering....

 

Is it possible to protect your JS file?

 

I read somewhere that you could scramble your JS file... but there were no further posts on that. Also i can only assume that a scrambled js file must be unscrambled at some point meaning that the unscramble function will be visible to the user meaning they would know how to unscramble the js file themselves.

 

I read that it is impossible to prevent the user from downloading the js file, is this true?

 

 

(this link is the discussion)

http://www.shaneng.net/Main/JavaScriptObfuscator

 

I found this free JavaScriptObfuscator... however being completely new to the concept... How do you implement the scrambled script to your site? Does it change all the functions names meaning you have to also change all the function names in the html source? 

Typically JS obfuscation (as with most) with change the variable names and the function names. With JS, I've found obfuscating (or even base64 encoding) can cause errors and typically isn't worth the trouble. Minifying is about as far as I go, even with files for work.

 

For minifying (which can slightly obfuscate a quick read) I typically use http://developer.yahoo.com/yui/compressor/ (or online variants)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.