Reverse Engineering a Bookmarklet


I tried to reverse engineer this Page Zipper bookmarklet. This is the original code I got from copy pasting the bookmarklet:


Decode with the decoder

Using this decoder:


De-obfuscate with JS Nice

Using JS Nice:

'use strict';
javascript: {
  (function() {
    if (window["pgzp"]) {
    } else {
      /** @type {boolean} */
      window._page_zipper_is_bookmarklet = true;
      /** @type {!Element} */
      window._page_zipper = document.createElement("script");
      /** @type {string} */
      window._page_zipper.type = "text/javascript";
      /** @type {string} */
      window._page_zipper.src = "//";


When the bookmarlet is executed, the bookmarklet creates a script element that references the main PageZipper functionalities script and adds it to the head of the page. The script with the main functionalities is The check for if (window["pgzp"]) is so that the bookmarklet doesn’t execute again if it’s already been executed on the page. If you click it while it’s already running, it stops running due calling the function _pgzpToggleBookmarklet(). This bookmarklet uses jQuery.

Written on April 18, 2018