Removing "CanvasJS Trial" text from CanvasJS, because $299 is too much for a student

I'm not a frontend developer. I don't even know JS.

I just want to make quick and easy dynamic charts for my app which will only run on my computer.

Step 1. Download CanvasJS

Click here. Be aware, it instantly downloads the zip. We will only need the canvasjs.min.js file.

Step 2. JavaScript Beautifier

Here is a nice JS Beautifier. It will help with code readability.

Step 3. Finding the string

If You scroll for some time, You'll see that some strings look weird, like "I`i`!vi`u!xntsd!mnnjhof!`u". In my case, most of these things were passed as arguments to ga(h) function. So let's see...

ga = function(h) {
  for (var n = "", s = 0; s < h.length; s++) n += String.fromCharCode(Math.ceil(h.length /
    57 / 5) ^ h.charCodeAt(s));
  return n
}
    

"String.fromCharCode" sure looks like a great catch here. Let's make a quick demo on playcode.io and check what it means.

var ga = function(h) {
  for (var n = "", s = 0; s < h.length; s++) n += String.fromCharCode(Math.ceil(h.length /
    57 / 5) ^ h.charCodeAt(s));
  return n
}

console.log(ga('I`i`!vi`u!xntsd!mnnjhof!`u'))
    

Gotcha. This function works in both ways, so we can find our beloved "CanvasJS Trial". It turns out to be "B`ow`rKR!Ush`m".

Step 4. Patching

Simply find our "B`ow`rKR!Ush`m" string in JS file, and replace it with nothing. Or use sed, "s/B`ow`rKR!Ush`m//g".