Show Password ondblclick

Show password when double clicking on password field

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name          Show Password ondblclick
// @namespace     http://mailerdaemon.home.comcast.net
// @include       *
// @description	  Show password when double clicking  on password field
// @version       2.2
// ==/UserScript==
//
// Based on "Show Password onMouseOver" by "LouCypher"
// enhanced by Hanjo
// reworked by BlindWanderer

// add a CSS rule (simpler way, using smarter CSS selector)
// To javascript 'was-password' isn't a known type value and so javascriptwill report the value as 'text' but to CSS it is still 'was-password'
GM_addStyle("input[type='was-password'] { border-style:solid!important; border-color:red!important;}");
	
//window.addEventListener("load", function(e) {
	var inputs, input;
	inputs = document.evaluate(
		"//input[@type]",
		document,
		null,
		XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
		null);
	for(var i = 0; input = inputs.snapshotItem(i); i++) {
		if(input.type.toLowerCase() == "password")//the browser isn't case sensative but xpath is ~_~ no biggy
		{
			input.addEventListener('dblclick', show, false);
			input.addEventListener('blur', hide, false);
		}
	}
//}, false);

function show(event)
{
	this.type = (this.type=='password')?'was-password':'password';
	this.select();
}
function hide(event)
{
	if(this.type != 'password')
		this.type = 'password';
}