]> git.ardis.lu - static-encrypt/commitdiff
Add helpers for direct calling in DevTools
authorArdis Lu <ardisglu@gmail.com>
Sat, 25 Feb 2023 04:45:43 +0000 (20:45 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sat, 25 Feb 2023 04:45:43 +0000 (20:45 -0800)
index.html

index 0c5b6854fb2964be4955c9a410910e03297aa0ee..8a21f8807fd4f0bd3b6b370795cc5f228ff151ce 100644 (file)
     })
 
     const template = await fetch('/template.html').then(r => r.text());
+
+    // For debugging and bulk usage in the DevTools console
+    function help() {
+      console.table({
+        'help(): void': 'Print this message.',
+        'encrypt(plaintext: string, password: string): Promise<string>': 'Encrypt a string.',
+        'decrypt(content: string, password: string): Promise<string>': 'Decrypt an encrypted string.'
+      });
+    }
+    globalThis.help = help;
+    globalThis.encrypt = encrypt;
+    globalThis.decrypt = decrypt;
+    help();
   </script>
 </body>
 
This page took 0.039005 seconds and 4 git commands to generate.