Skip to content

Instantly share code, notes, and snippets.

@son0fhobs
Created August 22, 2011 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save son0fhobs/1163723 to your computer and use it in GitHub Desktop.
Save son0fhobs/1163723 to your computer and use it in GitHub Desktop.
Firegestures - Search Google w/in Past Year
/**
* Author:
* David Hobson
* http://www.virtualidstudios.com
*
* Goal: Update Google Search to within past year
* Details:
* While on Google Search Page.
* Changing Search options with a Gesture. Current one changes search to within year.
*
* On first line, change part in quotes toward end.
* Year: &tbs=qdr:y
* Month: &tbs=qdr:m
* Week: &tbs=qdr:w
* Day: &tbs=qdr:d
*
* More options in comments below
*/
const URL = window.content.location.href+"&tbs=qdr:y";
const IN_NEW_TAB = false;
const IN_BACKGROUND = false;
if (IN_NEW_TAB)
gBrowser.loadOneTab(URL, null, null, null, IN_BACKGROUND, false);
else
gBrowser.loadURI(URL);
@son0fhobs
Copy link
Author

I know, this is painfully detailed, but I hate it when people are too vague.

This is designed to grab the url, edit it accordingly, paste it back in, and refresh the page with the new url. Thus it can be applied to virtually any url customization need.

For more google search changes, first run a search. Copy the url. Run another search using the search tool of choice. Copy url and compare. The difference is the bit of code that implemented the search tool. Use that to replace the "&tbs=qdr:y" Of course you can stack as many as you want one after the other in that same string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment