Projects STRLCPY link-lock Commits ab18295e
🤬
  • ■ ■ ■ ■ ■ ■
    hidden/decrypt-bookmarklet.js
    1 1  (() => {
    2  - 
    3 2  var b64 = (() => {
    4  - 
    5 3   function generateIndexDict(a) {
    6 4   let result = {};
    7 5   for (let i = 0; i < a.length; i++) {
    skipped 92 lines
    100 98  } catch {
    101 99   window.location.replace("https://gmail.com");
    102 100  }
    103  - 
    104 101  })();
    105 102   
  • ■ ■ ■ ■ ■ ■
    hidden/hidden.js
    skipped 8 lines
    9 9   * Helper Functions
    10 10   ******************************************************************************/
    11 11   
    12  -// Display a message in the "alert" area
     12 +/***
     13 + * Display a message in the "alert" area
     14 + */
    13 15  function error(text) {
    14 16   const alertText = document.querySelector(".alert");
    15 17   alertText.innerHTML = text;
    skipped 6 lines
    22 24   * Main UI Functions
    23 25   ******************************************************************************/
    24 26   
     27 +/***
     28 + * Create a hidden bookmark when the form is filled out.
     29 + */
    25 30  async function onHide() {
    26 31   // Fail if the b64 library or API was not loaded
    27 32   if (!("b64" in window && "apiVersions" in window)) {
    skipped 51 lines
    79 84   });
    80 85  }
    81 86   
     87 + 
     88 +/***
     89 + * Called when the "change location" button is clicked. Adjusts the destination
     90 + * of the decrypt bookmark via regular expressions.
     91 + */
    82 92  function onChangeDecrypt() {
    83 93   let newUrl;
    84 94   try {
    skipped 9 lines
    94 104   console.log(decryptBookmark.href);
    95 105  }
    96 106   
     107 + 
     108 +/***
     109 + * Get a random link from Wikipedia
     110 + */
    97 111  async function randomLink() {
    98 112   let page = await fetch("https://en.wikipedia.org/w/api.php?"
    99 113   + "format=json"
    skipped 13 lines
    113 127   document.querySelector("#bookmark-title").value = await page.title;
    114 128  }
    115 129   
     130 + 
     131 +/***
     132 + * If the page has a hash, autofill it.
     133 + *
     134 + * Run on page load.
     135 + */
    116 136  function main() {
    117 137   if (window.location.hash) {
    118 138   document.querySelector("#encrypted-url").value =
    skipped 6 lines
  • ■ ■ ■ ■ ■ ■
    hidden/index.html
    skipped 80 lines
    81 81   </details>
    82 82   
    83 83   <p><a class="bookmark" id="decrypt-bookmark" onclick="return false;" href='javascript:(() => {
    84  - 
    85 84  var b64 = (() => {
    86  - 
    87 85   function generateIndexDict(a) {
    88 86   let result = {};
    89 87   for (let i = 0; i < a.length; i++) {
    skipped 146 lines
Please wait...
Page is in error, reload to recover