Skip to content

Instantly share code, notes, and snippets.

@michaloo
Last active December 27, 2015 13:19
Show Gist options
  • Save michaloo/7332573 to your computer and use it in GitHub Desktop.
Save michaloo/7332573 to your computer and use it in GitHub Desktop.
Vault web interface helper
// ==UserScript==
// @id vault-settings
// @name vault settings
// @version 0.1
// @namespace
// @author michaloo
// @description
// @include file:///home/Tools/Vault.html
// @include https://getvau.lt/
// @run-at document-end
// @require http://code.jquery.com/jquery-2.0.3.min.js
// ==/UserScript==
// set your default settings - change value to "required" or "forbidden"
$('input[value="required"][name="lower"]').prop("checked", true);
$('input[value="forbidden"][name="upper"]').prop("checked", true);
$('input[value="allowed"][name="number"]').prop("checked", true);
$('input[value="allowed"][name="dash"]').prop("checked", true);
$('input[value="allowed"][name="space"]').prop("checked", true);
$('input[value="allowed"][name="symbol"]').prop("checked", true);
// set password length, max repetition, required max
$("#vlength").val(1);
$("#repeat").val(1);
$("#required").val(1);
// hide the generated password by default
$("#word").attr("type", "password");
// show and select the password for copying
$('#word').click(function(){
$("#word").attr("type", "text");
$("#word").select();
});
// hide it again on blur
$('#word').bind('blur', function(){
$("#word").attr("type", "password");
});
@michaloo
Copy link
Author

michaloo commented Nov 6, 2013

This is a User Script created with Firefox Scriptish Addon, but it seems that it's also working on Google Chrome with Tampermonkey Extension.

It is a helper for web interface of vault - simple password generator.
It does two things:

  • sets password generation settings (choosing which checkbox to check and set numeric settings) - cli version has such feature, web does not
  • hides generated password, showing it only for copying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment