NanoPi / Skip lmgtfy

// ==UserScript==
// @name           Skip lmgtfy
// @namespace      https://openuserjs.org/users/NanoPi
// @description    bypass lmgtfy.com and go straight to Google Search.
// @license        MIT
// @include        http://lmgtfy.com/?q=*
// @include        https://lmgtfy.com/?q=*
// @include        http://*.lmgtfy.com/?q=*
// @include        https://*.lmgtfy.com/?q=*
// @include        http://lmgtfy.app/?q=*
// @include        https://lmgtfy.app/?q=*
// @include        http://*.lmgtfy.app/?q=*
// @include        https://*.lmgtfy.app/?q=*
// @match          http://lmgtfy.com/?q=*
// @match          https://lmgtfy.com/?q=*
// @match          http://*.lmgtfy.com/?q=*
// @match          https://*.lmgtfy.com/?q=*
// @match          http://lmgtfy.app/?q=*
// @match          https://lmgtfy.app/?q=*
// @match          http://*.lmgtfy.app/?q=*
// @match          https://*.lmgtfy.app/?q=*
// @run-at         document-start
// @version        2021.05.27
// ==/UserScript==

// would rather not lose lmgtfy from back button.
// helps curiosity and debugging, allows recovering from fails
// it's not important enough to die if pushState is not available
if (history && history.pushState) { history.pushState(window.title,location.href); }

// if you need to change both .host and .pathname
// you can't do it directly to location.
// changing one in a single statement will stop script execution and redirect the page
var a = document.createElement('a');
a.href = location.href;
a.host = "google.com";
a.pathname = "/search";
location.href = a.href;