This question already has answers here:
How do I hide javascript code in a webpage?
(12 answers)
Closed 12 months ago.
Is there a way I can stop people from seeing the Javascript Source code that includes the Server API key and server information?
No, there is not.
You can obfuscate and minify your code, but that doesn't help since your users can look at their browser's Network Inspector instead.
This question already has answers here:
How can I use JavaScript source maps (.map files)?
(5 answers)
Closed 1 year ago.
I am working on an HCL Commerce project and I receive this error when I load cart page locally:
File not found: /MyWebExtSitesSAS/javascript/widgets.map
I cannot find anywhere in the web references for widgets.map. Can you describe me what is this file used for, and if I can ignore this error?
I repost the answer in the comment by #disinfor because it answered my question
You can ignore that. A map file is used for debugging purposes. When
you minify code, e.g. js, css, etc. it obviously becomes hard to read
to find any errors. The map file is used by a browser to show where in
the original, unminified code the error is coming from.
This question already has answers here:
Executing Javascript from Python
(7 answers)
Closed 7 years ago.
I have JS script that gets as a parameter another JS and unpack it (from eval(function) packers).
I tried to run it using PyExecJs but it raise me errors like execjs.RuntimeError: SyntaxError: Unexpected token ;
I tried to use PyV8 but I got a issues with install it..
Does anybody know another simple way to run JS through Python?
Maybe you can help subprocess. This is not the best solution. Maybe you have a bug script? You can lay out a script?
This question already has answers here:
Deobfuscating Javascript [closed]
(5 answers)
Closed 8 years ago.
How to un obfuscate java-script code like that : it takes alot of time to know the expression obfuscate for the javascript to protect the code , but I'm tring to get the main code of this script but don't know How ?
var _0x843d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x53\x4C\x41\x4D\x52","\x6E\x61\x76","\x72\x65\x73\x69\x7A\x65","\x77\x69\x64\x74\x68","\x74\x6F\x70\x2D\x6E\x61\x76\x2D\x63\x6F\x6C\x6C\x61\x70\x73\x65","\x68\x61\x73\x43\x6C\x61\x73\x73","\x2E\x6E\x61\x76\x62\x61\x72\x2D\x66\x69\x78\x65\x64\x2D\x74\x6F\x70","\x61\x64\x64\x43\x6C\x61\x73\x73","\x72\x65\x6D\x6F\x76\x65\x43\x6C\x61\x73\x73","\x74\x6F\x70","\x6F\x66\x66\x73\x65\x74","\x2E\x6E\x61\x76\x62\x61\x72","\x73\x63\x72\x6F\x6C\x6C","\x64\x72\x6F\x70\x64\x6F\x77\x6E","\x61\x63\x74\x69\x76\x65\x2D\x73\x75\x62","\x65\x61\x73\x65\x4F\x75\x74\x45\x78\x70\x6F","\x3A\x6E\x6F\x74\x28\x2E\x65\x78\x29","\x6F\x6E\x65\x50\x61\x67\x65\x4E\x61\x76","\x2E\x6E\x61\x76\x62\x61\x72\x2D\x6E\x61\x76\x20\x2E\x64\x72\x6F\x70\x64\x6F\x77\x6E","\x61\x63\x74\x69\x76\x65","\x2E\x6E\x61\x76\x62\x61\x72\x2D\x6E\x61\x76","\x73\x6C\x69\x64\x65\x44\x6F\x77\x6E\x48\x65\x61\x64","\x2D\x35\x30\x30\x70\x78","\x30","\x63\x73\x73","\x2E\x70\x61\x67\x65\x48\x65\x61\x64","\x2E\x70\x61\x67\x65\x48\x65\x61\x64\x20\x2E\x68\x65\x72\x6F\x20\x68\x31\x2C\x20\x2E\x70\x61\x67\x65\x48\x65\x61\x64\x20\x2E\x68\x65\x72\x6F\x20\x68\x33","\x72\x65\x61\x64\x79","\x30\x70\x78","\x31","\x65\x61\x73\x65\x4F\x75\x74\x43\x75\x62\x69\x63","\x61\x6E\x69\x6D\x61\x74\x65","\x2E\x70\x61\x67\x65\x48\x65\x61\x64\x20\x2E\x68\x65\x72\x6F\x20\x68\x33","\x2E\x70\x61\x67\x65\x48\x65\x61\x64\x20\x2E\x68\x65\x72\x6F\x20\x68\x31","\x64\x65\x6C\x61\x79","\x73\x74\x6F\x70","\x6C\x6F\x61\x64","\x70\x61\x72\x61\x6C\x6C\x61\x78","\x74\x6F\x75\x63\x68","\x73\x65\x74","\x72\x61\x6E\x64\x6F\x6D","\x69\x6E\x69\x74","\x70\x72\x65\x6C\x6F\x61\x64\x65\x72","\x6F\x76\x65\x72\x66\x6C\x6F\x77","\x76\x69\x73\x69\x62\x6C\x65","\x62\x6F\x64\x79","\x66\x61\x64\x65\x4F\x75\x74","\x23\x70\x72\x65\x6C\x6F\x61\x64\x65\x72","\x73\x6C\x69\x64\x65\x72","\x73\x75\x70\x65\x72\x73\x6C\x69\x64\x65\x73","\x6F\x77\x6C\x43\x61\x72\x6F\x75\x73\x65\x6C","\x65\x61\x63\x68","\x73\x6B\x69\x6C\x6C\x62\x61\x72","\x61\x6E\x69\x6D\x61\x74\x65\x64","\x75\x73\x65\x72\x41\x67\x65\x6E\x74","\x74\x65\x73\x74","\x64\x61\x74\x61\x2D\x70\x65\x72\x63\x65\x6E\x74","\x61\x74\x74\x72","\x2E\x73\x6B\x69\x6C\x6C\x62\x61\x72\x2D\x62\x61\x72","\x66\x69\x6E\x64","\x68\x65\x69\x67\x68\x74","\x6F\x75\x74\x65\x72\x48\x65\x69\x67\x68\x74","\x77\x61\x79\x70\x6F\x69\x6E\x74","\x2E\x73\x6B\x69\x6C\x6C\x62\x61\x72","\x76\x69\x64\x65\x6F\x42\x67\x59\x54","\x74\x75\x62\x75\x6C\x61\x72","\x3C\x69\x6D\x67\x20\x73\x72\x63\x3D\x27\x69\x6D\x67\x2F\x62\x67\x2D\x68\x65\x61\x64\x2D\x31\x2E\x6A\x70\x67\x27\x20\x61\x6C\x74\x3D\x27\x27\x20\x2F\x3E","\x68\x74\x6D\x6C","\x62\x6F\x6F\x74\x73\x74\x72\x61\x70\x43\x61\x72\x6F\x75\x73\x65\x6C","\x63\x61\x72\x6F\x75\x73\x65\x6C","\x66\x69\x74\x56\x69\x64\x73","\x70\x6F\x72\x74\x66\x6F\x6C\x69\x6F\x46\x69\x6C\x74\x65\x72","\x70\x72\x65\x76\x65\x6E\x74\x44\x65\x66\x61\x75\x6C\x74","\x63\x75\x72\x72\x65\x6E\x74","\x64\x61\x74\x61\x2D\x67\x72\x6F\x75\x70","\x61\x6C\x6C","\x69\x6E\x61\x63\x74\x69\x76\x65","\x2E\x70\x6F\x72\x74\x66\x6F\x6C\x69\x6F\x2D\x6C\x69\x6E\x6B","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x2C","\x73\x70\x6C\x69\x74","\x63\x6C\x69\x63\x6B","\x68\x6F\x76\x65\x72","\x70\x6F\x72\x74\x66\x6F\x6C\x69\x6F","\x70\x6F\x72\x74\x66\x6F\x6C\x69\x6F\x45\x78\x70\x61\x6E\x64\x65\x72","\x73\x63\x72\x6F\x6C\x6C\x41\x6E\x69\x6D","\x79\x65\x73","\x64\x65\x66\x61\x75\x6C\x74\x73","\x66\x6E","\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E","\x64\x61\x74\x61","\x64\x61\x74\x61\x2D\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E","\x64\x61\x74\x61\x2D\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E\x2D\x64\x65\x6C\x61\x79","\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E\x2D\x64\x65\x6C\x61\x79","\x20\x76\x69\x73\x69\x62\x6C\x65","\x25","\x2E\x61\x6E\x69\x6D\x61\x74\x65\x64","\x76\x69\x73\x69\x62\x69\x6C\x69\x74\x79","\x66\x69\x78\x65\x64","\x2E\x62\x61\x63\x6B\x67\x72\x6F\x75\x6E\x64\x2D\x6D\x69\x64\x64\x6C\x65\x2D\x66\x75\x6C\x6C","\x6D\x61\x67\x6E\x69\x66\x69\x63","\x6D\x61\x67\x6E\x69\x66\x69\x63\x50\x6F\x70\x75\x70","\x63\x6F\x6E\x74\x61\x63\x74\x46\x6F\x72\x6D","\x63\x6C\x69\x63\x6B\x20\x74\x6F\x75\x63\x68\x73\x74\x61\x72\x74","\x64\x69\x73\x61\x62\x6C\x65\x64","\x70\x72\x6F\x70","\x3C\x69\x20\x63\x6C\x61\x73\x73\x3D\x27\x66\x61\x20\x66\x61\x2D\x63\x6F\x67\x20\x66\x61\x2D\x73\x70\x69\x6E\x27\x3E\x3C\x2F\x69\x3E\x20\x53\x45\x4E\x44\x49\x4E\x47","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x73\x75\x62\x6D\x69\x74","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x66\x6F\x72\x6D","\x73\x65\x72\x69\x61\x6C\x69\x7A\x65","\x50\x4F\x53\x54","\x69\x6E\x63\x2F\x63\x6F\x6E\x74\x61\x63\x74\x2E\x70\x68\x70","\x6A\x73\x6F\x6E","\x73\x74\x61\x74\x75\x73","","\x76\x61\x6C","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x66\x6F\x72\x6D\x20\x69\x6E\x70\x75\x74","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x66\x6F\x72\x6D\x20\x74\x65\x78\x74\x61\x72\x65\x61","\x65\x6D\x70\x74\x79","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x66\x6F\x72\x6D\x2D\x72\x65\x73\x70\x6F\x6E\x73\x65","\x3C\x69\x20\x63\x6C\x61\x73\x73\x3D\x27\x66\x61\x20\x66\x61\x2D\x63\x68\x65\x63\x6B\x27\x3E\x3C\x2F\x69\x3E\x20\x53\x55\x42\x4D\x49\x54","\x61\x6A\x61\x78","\x6F\x6E"];
I have another question related to that , Could I use this script as it's or I have to decode it to use at my HTML5 page ?
The point of obfuscation is to make it very challenging to restore the original code as written while maintaining the same functionality. So to answer your first question there really is no way to get back to the original code as the author clearly didn't want you to see it or be able to edit it. To answer your second question yes you should be able to use it normally assuming it was properly obfuscated.
I suggest you do a little reading on the topic: http://en.wikipedia.org/wiki/Obfuscation_%28software%29
There might be a few deobfuscation tools out there for javascript, but the chance that these work well is probably low.
This question already has answers here:
Is there such a thing as a javascript deminifier (deobfuscator)? [closed]
(10 answers)
Closed 8 years ago.
This will without a doubt be a duplicate, but I have no idea what else to call it.
A friend of mine is trying to learn Javascript. He accidentally saved the "compressed" (all whitespace removed) version as the version he has, and wants me to help format it again. He's emailed me a massive .js file and... I'm not sure what to do.
I don't want to install (no doubt Eclipse has one) a Javascript plugin for Eclipse just to right click and format once. Is there a tool for this? A parser that'll build an AST then format that AST?
Tool to Unminify / Decompress JavaScript
Apparently JS beautifier will do the trick sometimes.
There's a plethora of others on there.