Created
May 21, 2019 17:35
-
-
Save brandonhellman/467673cfcf8d536a91e12c763f86b91c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Definitions Check - Find the Company Name from a text string | |
// @version 1.0.0 | |
// @include hit_set_id:37A2SHHJCAWEP4M3KM5DL9DVF4KKJX | |
// ==/UserScript== | |
const input = document.querySelector(`crowd-input`); | |
input.value = `x`; | |
input.focus(); | |
document.addEventListener(`selectionchange`, () => { | |
const selection = window.getSelection().toString().trim(); | |
if (selection.length && document.activeElement !== input) { | |
input.value = selection; | |
} | |
}); | |
document.addEventListener(`keydown`, (e) => { | |
if (e.key == `Enter`) { | |
document.querySelector(`[form-action="submit"]`).click(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment