Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brandonhellman/467673cfcf8d536a91e12c763f86b91c to your computer and use it in GitHub Desktop.
Save brandonhellman/467673cfcf8d536a91e12c763f86b91c to your computer and use it in GitHub Desktop.
// ==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