Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Lock
- // @namespace http://tampermonkey.net/
- // @version 2.15
- // @description Put passwords on sites I waste my time on
- // @author My cat
- // @match *://*/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- const protectedWebsites = [
- 'x.com',
- 'twitter.com',
- 'reddit.com',
- 'facebook.com',
- 'tiktok.com',
- 'old.reddit.com',
- ];
- const password = '5229773345560';
- const currentSite = window.location.hostname;
- const isProtected = protectedWebsites.some(site => currentSite.includes(site));
- if (isProtected) {
- let authenticated = false;
- while (!authenticated) {
- let userInput = prompt('Enter the password to access this site:');
- if (userInput === password) {
- authenticated = true;
- } else {
- alert('Incorrect password. Try again.');
- }
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement