MAX30 / smotriAutocomplete

// ==UserScript==
// @name smotriAutocomplete
// @description set autocomplete on
// @version 1.2
// @author Max Max
// @license MIT
// @include http://smotri.com
// @include http://smotri.com/
// @include http://smotri.com/*
// @include http://*
// @include http://*/
// @include http://*/*
// @match http://smotri.com
// @match http://smotri.com/
// @match http://smotri.com/*
// @match http://*
// @match http://*/
// @match http://*/*
// @icon http://i58.tinypic.com/1tpu1l.png
// @run-at document-end
// @grant none
// ==/UserScript==

// [1] не запускаем скрипт во фреймах
if (window.self != window.top) {return;}
// [2] не хлопаем ушами - при регистрации выход
if (document.getElementById('UserInbox')) {return;} 
// [3] теги формы регистрации
if (!document.getElementById('userLogin')) {return;} 
if (!document.getElementById('userPassword')) {return;} 
if (!document.getElementById('rememberLogin')) {return;} 

function setOn(){var a=document.getElementById("userLogin"),c=document.getElementById("userPassword"),b=document.getElementById("rememberLogin");if(a){a.autocomplete="on";c.autocomplete="on";click(b);show_note("AUTOCOMPLETE ON!")}}function click(b){var a=document.createEvent("MouseEvents");a.initMouseEvent("click",true,true,window,0,1,1,1,1,false,false,false,false,0,null);b.dispatchEvent(a)}function show_note(g){if(!g){return}var f=document,e,d="",b="",a="",c;e=f.getElementById("note");if(e){e.parentNode.removeChild(e)}e=f.createElement("div");c="data:image/gif;base64,R0lGODlhEAAQAJEDAICAgKCgpP///wAAACH5BAEAAAMALAAAAAAQABAAAAIvnI+py70AI3yi2goUEOH2nGxc1QkgInKlqVnBeh5iWcbGto72kF6sJok4hsSiogAAOw==";b+="position: absolute;";b+="z-index: 6001;";b+="top: 0; left: 0; right: 0;";b+="background: #fde073;";b+="text-align: center;";b+="font-weight: bold;";b+="color:#666;";b+="line-height: 2.5;";b+="overflow: hidden;";b+="—moz—opacity:0.9; —khtml—opacity: 0.9; -webkit-opacity: 0.9; opacity: 0.9;";b+="-webkit-box-shadow: 0 0 5px black; -moz-box-shadow: 0 0 5px black; box-shadow: 0 0 5px black;";a+="position: absolute;";a+="right: 10px; top: 9px;";a+="text-indent: -9999px;";a+="background: url("+c+");";a+="height: 16px; width: 16px;";a+="cursor: pointer;";e.setAttribute("id","note");e.setAttribute("style",b);e.innerHTML=""+g+'<a id="btn_close" style="'+a+'">[закрыть]</a>';f.body.insertBefore(e,f.body.firstChild);close=f.getElementById("btn_close");close.onclick=function(){e=f.getElementById("note");if(e){e.parentNode.removeChild(e)}}}window.onload=function(){setOn()};