Advertisement
geraldandy

Untitled

Oct 18th, 2024
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Lock
  3. // @namespace    http://tampermonkey.net/
  4. // @version      2.15
  5. // @description  Put passwords on sites I waste my time on
  6. // @author       My cat
  7. // @match        *://*/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     const protectedWebsites = [
  15.         'x.com',
  16.         'twitter.com',
  17.         'reddit.com',
  18.         'facebook.com',
  19.         'tiktok.com',
  20.         'old.reddit.com',
  21.     ];
  22.  
  23.     const password = '5229773345560';
  24.  
  25.     const currentSite = window.location.hostname;
  26.     const isProtected = protectedWebsites.some(site => currentSite.includes(site));
  27.  
  28.     if (isProtected) {
  29.         let authenticated = false;
  30.  
  31.         while (!authenticated) {
  32.             let userInput = prompt('Enter the password to access this site:');
  33.  
  34.             if (userInput === password) {
  35.                 authenticated = true;
  36.             } else {
  37.                 alert('Incorrect password. Try again.');
  38.             }
  39.         }
  40.     }
  41. })();
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement