Created
December 20, 2016 18:53
-
-
Save dylanlangston/f0f0a6b6a73f7e14b4b51c712a8f6861 to your computer and use it in GitHub Desktop.
Homepage Google focus fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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&&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