From 9ac38dade6445944cab1bde3676cba05b0cca1ab Mon Sep 17 00:00:00 2001 From: Dariusz Murakowski Date: Wed, 25 Apr 2018 16:16:49 -0400 Subject: [PATCH] LANL: HIValign: set e-mail twice, focus on title field --- HIValign- automatic e-mail address.user.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 HIValign- automatic e-mail address.user.js diff --git a/HIValign- automatic e-mail address.user.js b/HIValign- automatic e-mail address.user.js new file mode 100644 index 0000000..fb4b4c9 --- /dev/null +++ b/HIValign- automatic e-mail address.user.js @@ -0,0 +1,30 @@ +// ==UserScript== +// @name HIValign: automatic e-mail address +// @namespace http://tampermonkey.net/ +// @version 0.1 +// @description also focuses on "(optional) title" input field +// @author You +// @match https://www.hiv.lanl.gov/cgi-bin/VIRALIGN/viralign.cgi +// @grant none +// @run-at document-end +// ==/UserScript== + +(function() { + 'use strict'; + + function get0(s) { + var sel = document.querySelectorAll(s); + if (sel.length == 1) { + var out = sel[0]; + console.log(out); + return out; + } + } + + if (document.title == 'HIValign') { + var address = 'murakdar@mit.edu'; + get0('input[name=EMAIL]').value = address; + get0('input[name=EMAIL2]').value = address; + get0('input[name=titleFromUser]').focus(); + } +})(); \ No newline at end of file -- 2.7.4