// ==UserScript== // @name bing year search // @description changes default search entry to one year ago // @author jccalhoun // @version 0.1 // @license GNU General Public License version 3 or any later version; https://www.gnu.org/licenses/gpl-3.0.html // @include http://www.bing.com* // @include https://www.bing.com* // @include http://www.bing.com/search?* // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js // @grant none // @namespace https://greasyfork.org/users/9631 // @downloadURL none // ==/UserScript== $(function() { var runOnce = 1; $('.fs_label, .sw_ddbk').click(function() { var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear() - 1; var lastYear = mm+'/'+dd+'/'+yyyy; //console.log(lastYear); console.log(runOnce); if (runOnce <2) { setTimeout(function(){ document.getElementById('date_range_start').value=lastYear;}, 300); runOnce++; } // console.log(runOnce); }); //console.log(runOnce); });