NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Ctrl+Enter is submit everywhere // @namespace http://tampermonkey.net/ // @version 0.1 // @description Now pressing ctrl+Enter will submit everywhere in every site // @author Sela Oren // @license MIT // @grant none // ==/UserScript== (function() { 'use strict'; const possibleSubmitButtonTexts = ['Send'] // add more submit texts in the array for more support window.addEventListener('keypress', function(e){ if (e.ctrlKey && e.keyCode == 10) { let buttons = document.getElementsByTagName('button'); for (let i = 0; i < buttons.length; i++) { if (possibleSubmitButtonTexts.find(e => e === buttons[i].textContent) && buttons[i].getAttribute('type').toLowerCase() === 'submit') { buttons[i].click(); break; } } e.preventDefault(); if (e.shiftKey) { e.target.form.removeAttribute('target'); } } }, false); })();