Google Searches Exactly What You Type

Google searches for exactly what you type in by inserting nfpr=1 into the url.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           Google Searches Exactly What You Type
// @version       1.0.1
// @namespace      null
// @description    Google searches for exactly what you type in by inserting nfpr=1 into the url.
// @include        http://*.google.*/
// @include        https://*.google.*/
// @include        http://*.google.*/*q=*
// @include        https://*.google.*/*q=*
// @exclude        http://*.google.*/*nfpr=*
// @exclude        https://*.google.*/*nfpr=*
// @exclude        https://*.google.*/imgres*
// @exclude        http://*.google.*/imgres*
// @exclude        http://books.google.com/*
// @exclude        https://books.google.com/*
// @exclude        http*maps.google.com/*
// @exclude        http://news.google.com/newspapers*
// @exclude        https://news.google.com/newspapers*
// ==/UserScript==


var sTargetURL = window.location.href;
var sTargetURL1 = window.location.href.replace(/&q=/, '&nfpr=1&q=');
var sTargetURL2 = window.location.href.replace(/\?q=/, '?nfpr=1&q=');


if(sTargetURL1 == sTargetURL)
sTargetURL=sTargetURL2;
else
sTargetURL=sTargetURL1;

if(sTargetURL1 != sTargetURL2)
window.location.replace( sTargetURL );

var searchForms = document.querySelectorAll('form[action="/search"]');
var searchFormsLength = searchForms.length;
if (searchFormsLength) {

  var input   = document.createElement("input");
  input.name  = "nfpr";
  input.type  = "hidden";
  input.value = 1;

  var i = searchFormsLength;
  while (i--) {
    searchForms[i].appendChild(input);
  }
}