(function(){ var parent = document.getElementsByTagName('html')[0], sun = new Image; sun.src = chrome.extension.getURL('sun.png'); sun.width = '40'; sun.height = '40'; sun.style.position = 'fixed'; sun.style.right = '0'; sun.style.top = '0'; sun.style.zIndex = '1000'; sun.onclick = function() { document.getElementsByTagName('body')[0].style.display = 'none'; document.title = 'New Tab'; window.location.replace('https://google.com'); } parent.insertBefore(sun, parent.firstChild); })();