Skip to content

mhmda-83/show-passwords-bookmarklet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Password Toggle Bookmarklet

A simple JavaScript bookmarklet that allows you to toggle the visibility of password fields on any webpage.

What it does

  • First click: Reveals all hidden password fields by converting them to text fields
  • Second click: Hides all revealed password fields by converting them back to password fields

Installation

  1. Copy the bookmarklet code below
  2. Create a new bookmark in your browser
  3. Set the bookmark name to "Show Passwords" (or any name you prefer)
  4. Paste the code as the bookmark URL/location

Bookmarklet Code

javascript:(function()%7Blet%20shownPasswords%20%3D%20document.querySelectorAll('input%5Bdata-is-password-field%5D')%3B%0Aif%20(shownPasswords.length%20!%3D%200)%20%7B%0A%20%20for%20(let%20i%20%3D%200%3B%20i%20%3C%20shownPasswords.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20shownPasswords%5Bi%5D.type%20%3D%20'password'%3B%0A%20%20%20%20delete%20shownPasswords%5Bi%5D.dataset.isPasswordField%3B%0A%20%20%7D%0A%7D%20else%20%7B%0A%20%20let%20passwordElements%20%3D%20document.querySelectorAll('input%5Btype%3D%22password%22%5D')%3B%0A%20%20for%20(let%20i%20%3D%200%3B%20i%20%3C%20passwordElements.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20passwordElements%5Bi%5D.type%20%3D%20'text'%3B%0A%20%20%20%20passwordElements%5Bi%5D.dataset.isPasswordField%20%3D%20true%3B%0A%20%20%7D%0A%7D%7D)()%3B

How to Use

  1. Navigate to any webpage with password fields
  2. Click the bookmarklet to reveal all password fields
  3. Click the bookmarklet again to hide all password fields

Use Cases

  • Password verification: Check that you've typed your password correctly
  • Password requirements: Verify your password meets website requirements while typing
  • Form debugging: See what's actually in password fields during development or testing
  • Accessibility: Temporarily make passwords visible for users who have difficulty with hidden text

How it Works

The bookmarklet uses a toggle mechanism:

  1. Show passwords: Finds all input[type="password"] elements, changes them to type="text", and marks them with a data-is-password-field attribute
  2. Hide passwords: Finds all elements with the data-is-password-field attribute, changes them back to type="password", and removes the marker attribute

Browser Compatibility

This bookmarklet works in all modern browsers including:

  • Chrome
  • Firefox
  • Safari
  • Edge

Security Note

This bookmarklet only affects the current webpage temporarily. It does not store, transmit, or permanently modify any passwords. The password visibility is reset when you refresh the page.

About

a bookmarklet to show saved password!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published