paperlined.org
apps > bookmarklets > good_html > search
document updated 19 years ago, on Nov 25, 2005
drag_and_rename (411 characters)



// Use the selected words to search google.
// Pulled from http://www.google.com/options/winexplorer.html

q = (document.frames.length ? '' : document.selection.createRange().text);

for (i=0; i<document.frames.length; i++)
{
	q = document.frames[i].document.selection.createRange().text;
	if (q != '')
		break;
}

if (q == '')
	void(q = prompt('Enter text to search using Google. You can also highlight a word on this web page before clicking Google Search.',''));
	
if (q)
	location.href = 'http://www.google.com/search?client=googlet&q=' + escape(q)