﻿
// ==UserScript==
// @name		Google in English
// @author		Frans de Jonge
// @version 		1.02
// @description		Forces Google in English even though it keeps ignoring your preferred languages for web pages settings
// @include		http://www.google.*
// ==/UserScript==

/*
 Copyright © 2009, Frans de Jonge
 Released under the GPL license
 http://www.gnu.org/copyleft/gpl.html

 CHANGELOG
 1.0 2009-10-18 first release
 1.01 2009-10-18 renamed from google-in-english.js to google-in-english.user.js for GM's sake
 1.02 2009-10-19 GM runs on DOMContentLoaded, so of course it wouldn't work with addEventListener!
*/

(function() {
	
	if (
		!(
			window.location.href.match(/hl=en/)
			||
			document.getElementsByName('btnG')[0].getAttribute('value').match(/Search/)
		)
	)
	{
		if (window.location.href.match(/\?/))
			window.location.href += '&hl=en';
		else
			window.location.href = 'http://www.google.com/ncr';
	}

})();
