Monthly Archives: February 2017

Tip for Easily Backup Local Script Files in TruClient Lite Chrome

Currently TruClient Lite Chrome doesn’t support batch script operations. If the user want to back up all the local scripts, then they have to manually download the scripts one by one.
There are two ways to back up the scripts

  1. All the scripts are saved in the user data directory. So back up the user data directory will back up the script indirectly.
  2. We could use a hack way to download all the scripts as a single zip file.

Steps to back up user data folder

  1. Check the path from the command line of the shortcut of your TruClient Lite Chrome
    1. --user-data-dir=<profile dir> --extensions-on-chrome-urls --silent-debugger-extension-api --disable-web-security --no-first-run
  2. Back up the folder <profile dir>

Steps to download all the scripts as a single zip file

  1. Start the TruClient Lite
  2. Navigate to chrome://extensions/ to open the extension management pages for Chrome
  3. Check the Developer mode
  4. Click background page link for TruClient Lite
  5. Run the below code on console, the scripts will be saved
    1. var zip = new JSZip(); localforage.iterate((v, k) => { if(k.startsWith('/__scripts__/') && k.indexOf(':metadata:') === -1){ zip.file(k.split('/').pop()+'.zip', v); } }).then(()=>{ a = document.createElement('a'); a.href = window.URL.createObjectURL(zip.generate({type:"blob"})); = ""; a.dispatchEvent(new MouseEvent("click")); });
  6. Restart TruClient Lite