22
edits
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
== Implementation == | == Implementation == | ||
Visual hashing is implemented by including some javascript https://github.com/mozilla/watchdog/blob/master/data/js/visualhash.js https://github.com/mozilla/watchdog/blob/master/data/js/util.js into every webpage's runtime environment. This script looks for every input in the page's DOM, selects the ones that are password inputs, and then attaches event handlers to onkeydown, onfocus, and onblur. | Visual hashing is implemented by including some javascript [https://github.com/mozilla/watchdog/blob/master/data/js/visualhash.js] [https://github.com/mozilla/watchdog/blob/master/data/js/util.js] into every webpage's runtime environment. This script looks for every input in the page's DOM, selects the ones that are password inputs, and then attaches event handlers to onkeydown, onfocus, and onblur. | ||
When the user types inside the input widget (fires onkeydown events), an offscreen <canvas> element is created, on which the visual hash is drawn. The widget's CSS background is set to the canvas' dataURL, until the user types again (in which case the hash is updated) or changes focus from the password input (in which case the widget's original style is restored). | When the user types inside the input widget (fires onkeydown events), an offscreen <canvas> element is created, on which the visual hash is drawn. The widget's CSS background is set to the canvas' dataURL, until the user types again (in which case the hash is updated) or changes focus from the password input (in which case the widget's original style is restored). |
edits