// ==UserScript== // @name Hippietrail's StackExchange search to Google search // @description Convert a search on a StackExchange site to a Google search of that site // @version 0.0 // @namespace hippietrail // @include http://stackoverflow.com/search* // @include http://meta.stackoverflow.com/search* // @include http://serverfault.com/search* // @include http://meta.serverfault.com/search* // @include http://superuser.com/search* // @include http://meta.superuser.com/search* // @include http://stackapps.com/search* // @include http://*.stackexchange.com/search* // @include http://meta.*.stackexchange.com/search* // ==/UserScript== function main() { $('#bigsearch tr:last td:first').removeProp('colspan') .parent().append(''); $('input[name=google]').click(function (event) { location.href = 'http://google.com' + location.pathname + location.search + '+site:' + location.hostname; }); } function addJsNode(func) { 'use strict'; var targ = document.getElementsByTagName('head')[0] || document.body || document.documentElement, scriptNode = document.createElement('script'); scriptNode.type = 'text/javascript'; scriptNode.textContent = '(' + func.toString() + ')()'; targ.appendChild(scriptNode); } addJsNode(main);