Skip to content

Instantly share code, notes, and snippets.

@mikedfunk
Last active April 21, 2018 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikedfunk/43b0778563b19a946444f63f60734ab6 to your computer and use it in GitHub Desktop.
Save mikedfunk/43b0778563b19a946444f63f60734ab6 to your computer and use it in GitHub Desktop.
Couchbase userscript
// ==UserScript==
// @name Couchbase authentication fix
// @description Fixes couchbase's inability to save password.
// @include http://couch.local.*.com/ui/index.html*
// @include http://couch*.*.aws.*.com:*/ui/index.html*
// @version 1.0
// ==/UserScript==
function fixAutoComplete () {
setTimeout(function () {
var passwordElement = document.querySelectorAll('input[type="password"]')[1];
passwordElement.removeAttribute('readonly');
passwordElement.removeAttribute('disabled');
passwordElement.removeAttribute('mn-autocomplete-off');
passwordElement.removeAttribute('autocomplete');
console.log('Fixed couchbase autocomplete');
}, 1000);
}
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ fixAutoComplete +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment