Skip to content

Instantly share code, notes, and snippets.

@dylanlangston
Created December 20, 2016 18:53
Show Gist options
  • Save dylanlangston/f0f0a6b6a73f7e14b4b51c712a8f6861 to your computer and use it in GitHub Desktop.
Save dylanlangston/f0f0a6b6a73f7e14b4b51c712a8f6861 to your computer and use it in GitHub Desktop.
Homepage Google focus fix
// ==UserScript==
// @name New Tab Autofocus Respect
// @description Forces Firefox to Respect new tabs autofocus.
// @author Dylan Langston
// @namespace https://gist.github.com/dylanlangston/f0f0a6b6a73f7e14b4b51c712a8f6861/raw/429d375ab2c95c3386c94561bbd945645ede6745/newtab.user.js
// @version 1.0
// @run-at document-start
// @include about:blank?newtabpage
// @grant none
// ==/UserScript==
document.body.innerHTML = '<!DOCTYPE html><html><body><form><input type="1" name="2" value=Please Wait..."" autofocus style="color:transparent;border: 0px solid;"></form><img alt="" id="logo" src="http://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png" srcset="http://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png 1x, http://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png 2x" style="display: block;margin-left: auto;margin-right: auto;padding-top:159px;" onload="window.lol&amp;&amp;lol()" height="92" width="272"></img></body></html>';
var img = document.getElementById('logo');
img.onerror = function () {
this.style.display = 'none';
}
window.location.replace('https://www.google.com');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment