Mungkin setelah lihat gambar saja, teman-teman sudah paham untuk apa script yang saya akan berikan kepada teman-teman semua, nah ini hadir disaat saya ingin menggunakan mozilla untuk membuka semua account gmail saya secara bersamaan, dan ternyata tak bisa, artinya kita mesti modifikasi sedikit mozillanya. sebelum saya memberikan script nya ada baiknya saya jelaskan cara memasang nya.
Userscripts dan Firefox
Greasemonkey adalah ekstensi untuk Mozilla Firefox, sebuah open source Web Browser. Paling userscripts ditulis untuk Firefox & Greasemonkey (meskipun beberapa orang bekerja di Opera, Safari dan Internet Explorer).
Panduan ini saya akan menganggap anda menggunakan Firefox, jika tidak Anda harus memasang Firefox dulu.
Userscripts dijalankan melalui Greasemonkey
Sekarang bahwa Anda memiliki Firefox, anda perlu menginstal Greasemonkey. Setelah instalasi (yang memerlukan restart browser anda), anda telah siap untuk menginstal userscripts.
Sekarang mengklik. User.js link ke Greasemonkey memicu pop up script instalasi panel. Greasemonkey menunjukkan daftar situs apa script akan berjalan dan menanyakan apakah anda ingin menginstal script.
Sekarang loading halaman web hasil tambahan dalam kode (di userscript) sedang berjalan
Dengan penjelasan singkat itu mungkin sudah dapat di pahami cara melakukannya. silahkan gunakan script berikut ini
';
// ==UserScript==
// @name Google Account Multi-Login
// @namespace http://www.crappytools.net
// @description Replaces "Sign Out" link on Google pages with a select box of accounts.
// @include http://*.google.tld/*
// @include https://*.google.tld/*
// @include http://google.tld/*
// @include https://google.tld/*
// @exclude http*://mail.google.tld/*ui=1*
// ==/UserScript==
// Begin Script Update Checker code
var SUC_script_num = 16341;
var version_timestamp = 1241062573298; // This is here for the previous version of the updater script to find.
try{function updateCheck(forced){if ((forced) || (parseInt(GM_getValue('SUC_last_update', '0')) + 86400000 <= (new Date().getTime()))){try{GM_xmlhttpRequest({method: 'GET',url: 'http://userscripts.org/scripts/source/'+SUC_script_num+'.meta.js?'+new Date().getTime(),headers: {'Cache-Control': 'no-cache'},onload: function(resp){var local_version, remote_version, rt, script_name;rt=resp.responseText;GM_setValue('SUC_last_update', new Date().getTime()+'');remote_version=parseInt(/@uso:version\s*(.*?)\s*$/m.exec(rt)[1]);local_version=parseInt(GM_getValue('SUC_current_version', '-1'));if(local_version!=-1){script_name = (/@name\s*(.*?)\s*$/m.exec(rt))[1];GM_setValue('SUC_target_script_name', script_name);if (remote_version > local_version){if(confirm('There is an update available for the Greasemonkey script "'+script_name+'."\nWould you like to go to the install page now?')){GM_openInTab('http://userscripts.org/scripts/show/'+SUC_script_num);GM_setValue('SUC_current_version', remote_version);}}else if (forced)alert('No update is available for "'+script_name+'."');}else GM_setValue('SUC_current_version', remote_version+'');}});}catch (err){if (forced)alert('An error occurred while checking for updates:\n'+err);}}}GM_registerMenuCommand(GM_getValue('SUC_target_script_name', '???') + ' - Manual Update Check', function(){updateCheck(true);});updateCheck(false);}catch(err){}
// End Script Update Checker code
if (document.domain.indexOf("google.") == -1) return;
// Load persistent user data
if (!GM_getValue)
{alert("You need the newest version of Greasemonkey to run this script. Please upgrade."); return;}
usernames = GM_getValue("usernames", "").split(",");
passwords = GM_getValue("passwords", "").split(",");
autologin = GM_getValue("autologin", "");
if (typeof(autologin) == "boolean") // For backwards compatibility with older versions of the script
{
var al = new Array(usernames.length);
for (var i = 0; i < usernames.length; i++)
{al[i] = "false";}
autologin = al;
GM_setValue("autologin", al.join(","));
}
else
{autologin = autologin.split(",");}
function makeUserList(prefix, suffix, numbered)
{
if (usernames[0] == "")
return "";
a = "";
for (i = 0; i < usernames.length; i++)
{
a += prefix;
if (numbered)
a += (i+1) + ") "
a += usernames[i] + suffix;
}
return a;
}
function getService()
{
if (document.domain.indexOf("docs.google") != -1)
{return "writely";}
else if (document.location.href.indexOf("/webmasters/") != -1)
{return "sitemaps";}
else if (document.location.href.indexOf("/calendar/") != -1)
{return "cl";}
else if (document.domain.indexOf("picasaweb.google") != -1)
{return "lh2";}
else
{return "mail";}
}
function onSelectChange()
{
var i = this.selectedIndex - 2;
var len = this.length;
if ((i < len - 5) && ( i >= 0))
{
var un = usernames[i];
var pw = passwords[i];
var al = autologin[i];
var d = /.*?@(.*?)$/.exec(un);
if ((d != null) && (d[1] != "gmail.com") && (d[1] != "googlemail.com"))
{this.parentNode.action = 'https://www.google.com/a/' + d[1] + '/LoginAction2';}
if (pw == "")
{pw = prompt('Password for ' + un + ":");}
if (pw != null)
{
this.parentNode.Email.value = un;
this.parentNode.Passwd.value = pw;
this.parentNode.PersistentCookie.value = al;
this.parentNode.submit();
}
}
else if (i == len - 5)
{
var u, p;
if (((u = prompt('Username:')) != null) && ((p = prompt('Password (leave blank to prompt every time):')) != null))
{
if ((u.indexOf(',') != -1) || (p.indexOf(',') != -1))
{alert('Usernames and passwords cannot contain commas.');}
else
{
var a = confirm('Turn on autologin for this account?') + "";
if ((usernames[0] == "") || (GM_getValue("usernames", "") == ""))
{var u2 = u; var p2 = p; var a2 = a;}
else
{
var u2 = GM_getValue('usernames') + ',' + u;
var p2 = GM_getValue('passwords') + ',' + p;
var a2 = GM_getValue('autologin') + ',' + a;
}
GM_setValue('usernames', u2); usernames = u2.split(',');
GM_setValue('passwords', p2); passwords = p2.split(',');
GM_setValue('autologin', a2); autologin = a2.split(',');
for (var j = 0; j < 4; j++)
{this.options[len - j] = new Option(this.options[len-j-1].text);}
this.options[len-4] = new Option(u);
this.options[len-3].disabled = "disabled";
alert('Account added.');
}
}
this.selectedIndex = 0;
}
else if (i == len - 4)
{
if (usernames[0] == "")
{alert("No accounts to remove.");}
else
{
u = parseInt(prompt('Enter the number of the account to be removed:' + makeUserList("\n", "", true)));
if (isNaN(u)) {}
else if ((u < 1) || (u > usernames.length))
{alert('Invalid option.')}
else
{
u = usernames[u-1];
var un = GM_getValue('usernames').split(',');
var pw = GM_getValue('passwords').split(',');
var al = GM_getValue('autologin').split(',');
var j = -1;
for (var k = 0; k < un.length; k++)
{if(un[k]==u) j=k;}
if (j == -1)
{alert('Account appears to have already been removed. Refresh the page to update account list.');}
else
{
un.splice(j, 1);
pw.splice(j, 1);
al.splice(j, 1);
GM_setValue('usernames', un.join(',')); usernames = un;
GM_setValue('passwords', pw.join(',')); passwords = pw;
GM_setValue('autologin', al.join(',')); autologin = al;
this.remove(j+2);
alert('Account removed.');
}
}
}
this.selectedIndex = 0;
}
else if (i == len - 3)
{
var d = /google\.[^\/]*?\/a\/(.*?)\//.exec(document.location.href);
if (d != null)
{var s = 'https://www.google.com/a/' + d[1] + '/Logout';}
else if (document.domain.indexOf("mail.google") != -1)
{var s = 'https://mail.google.com/mail/?logout';}
else if (document.domain.indexOf("docs.google") != -1)
{var s = 'https://docs.google.com/logout';}
else if (document.location.href.indexOf("/calendar/") != -1)
{var s = 'https://www.google.com/calendar/logout';}
else if (document.domain.indexOf("picasaweb.google") != -1)
{var s = 'http://picasaweb.google.com/bye?continue=https%3A%2F%2Fwww.google.com%2Faccounts%2FLogout%3Fcontinue%3Dhttp%253A%252F%252Fpicasaweb.google.com';}
else
{var s = 'http://www.google.com/accounts/Logout?continue=' + escape(window.location.href.split("#")[0]);}
document.location.href = s;
}
}
function getSelectBox()
{
selectBox = document.createElement("span");
selectBox.innerHTML = '
return selectBox;
}
function findLink(p)
{
var langs = new Array("sign out", "keluar", "surt", "log ud", "abmelden", unescape("logi v%E4lja"), "salir", unescape("d%E9connexion"), "odjava", "odjavite se", "esci", unescape("skr%E1 %FAt"), "iziet", "atsijungti", unescape("i%u0161siregistruoti"), unescape("kil%E9p%E9s"), "logg av", "logg ut", "afmelden", "wyloguj", "sair", unescape("terminar sess%E3o"), "deconectati-va", unescape("ie%u015Fire"), unescape("odhl%E1si%u0165 sa"), "odjava", "kirjaudu ulos", "logga ut", unescape("thoa%u0301t"), unescape("tho%E1t"), unescape("%E7%u0131k%u0131%u015F"), "oturumu kapat", unescape("odhl%E1sit"), unescape("%u03AD%u03BE%u03BF%u03B4%u03BF%u03C2"), unescape("%u0437%u0430%u043A%u043E%u043D%u0447%u0438%u0442%u044C%20%u0440%u0430%u0431%u043E%u0442%u0443"), unescape("%u0432%u044B%u0439%u0442%u0438"), unescape("%u043E%u0434%u0458%u0430%u0432%u0438%u0442%u0435%20%u0441%u0435"), unescape("%u0432%u0438%u0439%u0442%u0438"), unescape("%u0438%u0437%u0445%u043E%u0434"), unescape("%u05D4%u05EA%u05E0%u05EA%u05E7"), unescape("%u05E6%u05D0"), unescape("%u062A%u0633%u062C%u064A%u0644%20%u0627%u0644%u062E%u0631%u0648%u062C"), unescape("%u0938%u093E%u0907%u0928%20%u0906%u0909%u091F%20%u0915%u0930"), unescape("%u0928%u093F%u0930%u094D%u0917%u092E"), unescape("%u0E2D%u0E2D%u0E01%u0E08%u0E32%u0E01%u0E23%u0E30%u0E1A%u0E1A"), unescape("%u767B%u51FA"), unescape("%u9000%u51FA"), unescape("%u30ED%u30B0%u30A2%u30A6%u30C8"), unescape("%uB85C%uADF8%uC544%uC6C3"));
try
{
var links = p.getElementsByTagName("a");
for (var i = 0; i < links.length; i++)
{
//alert(links[i].innerHTML.toLowerCase())
for (var j = 0; j < langs.length; j++)
{
if (links[i].innerHTML.toLowerCase().indexOf(langs[j]) != -1 && /google\..*?logout/i.test(links[i].href))
{
sb = getSelectBox();
links[i].parentNode.replaceChild(sb, links[i]);
//win.document.forms.namedItem("gmLoginForm").elements.namedItem("gmSelectLogin").addEventListener('change', onSelectChange, true);
sb.firstChild.elements.namedItem("gmSelectLogin").addEventListener('change', onSelectChange, true);
}
}
}
}
catch (e) {;}
}
if (unsafeWindow.frames.length == 0)
{f = new Array(unsafeWindow);}
else
{
f = new Array(unsafeWindow.frames.length + 1);
for (var i=0; i < unsafeWindow.frames.length; i++)
{f[i] = unsafeWindow.frames[i];}
f[unsafeWindow.frames.length] = unsafeWindow;
}
for (var i=0; i < f.length; i++)
{
f[i].addEventListener('load', function()
{
if ((document.domain.indexOf("mail") != -1) && (unsafeWindow.gmonkey))
{
unsafeWindow.gmonkey.load("1.0", function(gmAPI)
{
findLink(gmAPI.getMastheadElement().parentNode, unsafeWindow);
});
}
findLink(document, unsafeWindow);
if (frames.length > 0)
{
for (var k = 0; k < frames.length; k++)
{findLink(frames[k].document, frames[k]);}
}
}, true);
}
Semoga bermanfaat. :)
Salam...
the 4 c 3 o a.k.a Maulana
0 komentar:
Posting Komentar