Skip to content

Instantly share code, notes, and snippets.

@lipkau
Last active June 11, 2022 08:59
Show Gist options
  • Save lipkau/bd3cdcc65b135e8cfc0555203ba790e3 to your computer and use it in GitHub Desktop.
Save lipkau/bd3cdcc65b135e8cfc0555203ba790e3 to your computer and use it in GitHub Desktop.
Userscriptfor fixing the login form from QNAP, as they user a `textarea` for the username and password managers (1password in my case) can't fill it in. https://www.greasespot.net/
// ==UserScript==
// @name Fix QNap Login Fields
// @description Replace the input field for the QNap login screen for 1password to be able to fill them out
// @namespace https://gist.github.com/lipkau/
// @version 0.3
// @author Oliver Lipkau
// @match https://nas/cgi-bin/login.html*
// @icon https://www.google.com/s2/favicons?domain=myqnapcloud.com
// @grant GM_info
// @require https://code.jquery.com/jquery-3.6.0.min.js#sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=
// @updateURL https://gist.github.com/lipkau/bd3cdcc65b135e8cfc0555203ba790e3/raw/FixQNapLoginFields.user.js
// @downloadURL https://gist.github.com/lipkau/bd3cdcc65b135e8cfc0555203ba790e3/raw/FixQNapLoginFields.user.js
// @supportURL https://gist.github.com/lipkau/bd3cdcc65b135e8cfc0555203ba790e3
// ==/UserScript==
(function() {
'use strict';
console.debug('Loaded userscript', GM.info.script.name, GM.info.script.version);
const textarea = $('textarea#username');
if (textarea) {
const input = $('<input type="text">');
$.each(textarea.get(0).attributes, (index, attr) => {
input.attr(attr.nodeName, attr.nodeValue);
});
textarea.after(input).remove();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment