Posts

Showing posts with the label javascript

Packing and Obfuscating Javascript Files, and also Deobfuscation

I personally wrote a thesis about Java obfuscation. Really. Anyway, this post would talk about Javascript file packing. There are several benefits of doing the packing process : Minimizing the javascript file size, therefore speeding up the website download time for users using mobile device and less-than-3G bandwidths Obfuscating the content of the javascript file, keeping unwanted eyes or parties (such as your client) from reading your source code. You might have spend much time and effort writing them so you don't want anyone to easily copy and modify your works. But in some organization, like where I worked, needed to change the source code now and then. Normally we include a contract clause such as these "full source code of the application built must be given to the company that paid for the programming work". But sometimes we forgot to state the clause, or we might forgot to remind the programmer about the clause, leaving us without the original source code...

CORS - Cross Origin Resource Sharing using CouchDB

Recently I tried to build a simple application which creates simple math questions, and records the time taken by the student to finish one page of questions. The short story is that I finally succeeded in implementing the question generation by using Javascript without any server side programming. But what about recording the time taken? We need some database in some server for that. I want to use a database, but I don't want to  code server-side. So I guess CouchDB is a good choice, given that it supports REST-based API and all. It turned out that calling HTTP REST service from  the browser is much more complicated than calling the same service from the server. To make a long story short, here is what I found : Javascript running in a page in a web browser are not allowed to call urls outside the domain of the page.  Except, when the server serving the URL specifically allowed this by giving Cross Origin Resource Sharing header. Credentials passing is doubly diff...