Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ilx_prefsCom = Components.classes['@mozilla.org/preferences-service;1'].getService(
- Components.interfaces.nsIPrefBranch);
- var ilx_prefsBranch = Components.classes['@mozilla.org/preferences-service;1'].getService(
- Components.interfaces.nsIPrefService).getBranch("extensions.illimitux.").QueryInterface(
- Components.interfaces.nsIPrefBranch2);
- var ilx_vers = "4.0";
- var ilx_uu = "http://www.illimitux.net/";
- var ilx_lastLabel = "";
- var ilx_lastAly = "no";
- var ilx_firstLoch = "";
- var ilx_linkDivx = "";
- var ilx_framesnotChanged = true;
- var ilx_welcomed = false;
- var ilx_Backup_Time = "";
- var ilx_Backup_Time_second = "";
- var ilx_fullname = new Array;
- ilx_fullname.mv = "MegaVideo";
- ilx_fullname.mp = "MegaPorn";
- ilx_fullname.zs = "zShare";
- ilx_fullname.df = "DepositFiles";
- ilx_fullname.mu = "MegaUpload";
- ilx_fullname.veoh = "Veoh";
- ilx_fullname.noveoh = "Veoh";
- ilx_fullname.rs = "Rapidshare";
- ilx_fullname['4s'] = "4shared";
- function ilx_rand(min, max){
- var argc = arguments.length;
- if (argc === 0){
- min = 1000;
- max = 50000;
- }
- else if (argc === 1){
- }
- return Math.floor(Math.random() * (max - min + 1)) + min;
- }
- function ilx_utf8_encode(argString){
- var string = (argString + "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
- var utftext = "";
- var start, end;
- var stringl = 0;
- start = end = 0;
- stringl = string.length;
- for (var n = 0; n < stringl; n ++ ){
- var c1 = string.charCodeAt(n);
- var enc = null;
- if (c1 < 128){
- end++;
- }
- else if (c1 > 127 && c1 < 2048){
- enc = String.fromCharCode(c1 >> 6 | 192) + String.fromCharCode(c1 & 63 | 128);
- }
- else {
- enc = String.fromCharCode(c1 >> 12 | 224) + String.fromCharCode(c1 >> 6 & 63 | 128) +
- String.fromCharCode(c1 & 63 | 128);
- }
- if (enc !== null){
- if (end > start){
- utftext += string.substring(start, end);
- }
- utftext += enc;
- start = end = n + 1;
- }
- }
- if (end > start){
- utftext += string.substring(start, string.length);
- }
- return utftext;
- }
- function ilx_convert(data){
- var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = [];
- if (!data){
- return data;
- }
- data = ilx_utf8_encode(data + "");
- do {
- o1 = data.charCodeAt(i ++ );
- o2 = data.charCodeAt(i ++ );
- o3 = data.charCodeAt(i ++ );
- bits = o1 << 16 | o2 << 8 | o3;
- h1 = bits >> 18 & 63;
- h2 = bits >> 12 & 63;
- h3 = bits >> 6 & 63;
- h4 = bits & 63;
- tmp_arr[ac ++ ] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
- }
- while (i < data.length);
- enc = tmp_arr.join("");
- switch(data.length % 3){
- case1 : enc = enc.slice(0 ,- 2) + "==";
- break ;
- case2 : enc = enc.slice(0 ,- 1) + "=";
- break ;
- default:;
- }
- enc = enc.replace(/=/g, "0Oox");
- enc = enc.replace(/\+/g, "1Iix");
- enc = enc.replace(/\//g, "Yyux");
- return enc;
- }
- function ilx_lcz(args, reps){
- tort = args.replace("%@", reps);
- return tort;
- }
- function ilx_openTab(args){
- if (ilx_prefsBranch.getBoolPref("ilx_pref_tab")){
- var win = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(
- Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser");
- win.openUILinkIn(args, "tab");
- }
- else {
- window.content.document.location.href = args;
- }
- }
- function ilx_clearHTML(obj){
- while (obj.firstChild){
- obj.removeChild(obj.firstChild);
- }
- }
- function ilx_addTxt(args, txt){
- args.appendChild(document.createTextNode(txt));
- }
- function ilx_clear_addTxt(args, txt){
- ilx_clearHTML(args);
- ilx_addTxt(args, txt);
- }
- function ilx_getdocuments(){
- var allDocuments = new Array;
- allDocuments.push(window.top.getBrowser().selectedBrowser.contentWindow.document);
- var allFrames = window.top.getBrowser().selectedBrowser.contentWindow.frames;
- for (var i = 0; i < allFrames.length; i ++ ){
- allDocuments.push(allFrames[i].document);
- }
- return allDocuments;
- }
- function ilx_unecape(str){
- str = str.split("<").join("1");
- str = str.split("{").join("2");
- str = str.split("]").join("3");
- str = str.split("[").join("4");
- str = str.split("}").join("5");
- str = str.split("|").join("6");
- str = str.split(">").join("7");
- cf = str.length;
- fin = "";
- while (cf >= 0){
- fin += str.charAt(cf);
- cf--;
- }
- t = fin;
- return unescape(t);
- }
- function ilx_removeChildrenFromNode(e){
- if (!e){
- return false;
- }
- if (typeof e == "string"){
- e = xGetElementById(e);
- }
- while (e.hasChildNodes()){
- e.removeChild(e.firstChild);
- }
- return true;
- }
- function ilx_opensite(args){
- window.opener.openURL(ilx_uu + args + ".php");
- }
- function ilx_geturls(){
- var url_list = new Array;
- var docs = ilx_getdocuments(window.content);
- var embeds = new Array;
- var parms = new Array;
- for (var j = 0; j < docs.length; j ++ ){
- var this_iframes = docs[j].getElementsByTagName("iframe");
- for (var c = 0; c < this_iframes.length; c ++ ){
- if (this_iframes[c].src != ""){
- this_iframes[c].addEventListener("load", ilx_updateIcon_frm, true);
- }
- }
- var this_embeds = docs[j].getElementsByTagName("embed");
- for (var c = 0; c < this_embeds.length; c ++ ){
- if (this_embeds[c].src != ""){
- url_list.push(this_embeds[c].src);
- }
- }
- var this_parms = docs[j].getElementsByTagName("param");
- for (var x = 0; x < this_parms.length; x ++ ){
- if (this_parms[x].getAttribute("name") == "movie"){
- if (this_parms[x].getAttribute("value") != ""){
- url_list.push(this_parms[x].getAttribute("value"));
- }
- }
- }
- }
- return url_list;
- }
- function ilx_getCnt(){
- var targetBrowser = window.top.getBrowser().selectedBrowser;
- if (targetBrowser && targetBrowser.currentURI.spec){
- var xmlserial = new XMLSerializer;
- var doc = new XPCNativeWrapper(targetBrowser.contentWindow, "document");
- var mainstr = xmlserial.serializeToString(doc.document);
- return mainstr;
- }
- }
- function ilx_analyseEmbed(){
- var uris = ilx_geturls();
- if (uris.length != 0){
- var y = 0;
- var Vid = new Array;
- for (x = 0; x < uris.length; x ++ ){
- if (uris[x].indexOf("megavideo", 0) != "-1"){
- ff = uris[x].split("v=");
- if (!ff[1]){
- ff = uris[x].split("/e/");
- }
- if (!ff[1]){
- ff = uris[x].split("/v/");
- }
- Vid[y] = new Array;
- Vid[y].kind = "megavideo";
- Vid[y].vid = ff[1].substring(0, 8);
- y++;
- }
- if (uris[x].indexOf("megaporn", 0) != "-1"){
- ff = uris[x].split("v=");
- if (!ff[1]){
- ff = uris[x].split("/e/");
- }
- if (!ff[1]){
- ff = uris[x].split("/v/");
- }
- Vid[y] = new Array;
- Vid[y].kind = "megaporn";
- Vid[y].vid = ff[1].substring(0, 8);
- y++;
- }
- if (uris[x].indexOf("permalinkId=", 0) != "-1" && uris[x].indexOf("veoh", 0) != "-1"
- ){
- ff = uris[x].split("permalinkId=");
- ff = ff[1].split("#").join("");
- ff2 = ff.split("&");
- Vid[y] = new Array;
- Vid[y].kind = "veoh";
- Vid[y].vid = ff2[0];
- y++;
- }
- }
- return Vid;
- }
- else {
- var walo = new Array;
- return walo;
- }
- }
- function ilx_removeLoading(){
- if (document.getElementById("chargement_ilx")){
- document.getElementById("ilx_mgttext").removeChild(document.getElementById(
- "chargement_ilx"));
- }
- }
- function ilx_setLoading(args){
- ilx_removeLoading();
- loadLabel = document.createElement("label");
- loadLabel.setAttribute("value", args);
- loadLabel.id = "chargement_ilx";
- document.getElementById("ilx_mgttext").appendChild(loadLabel);
- }
- function ilx_setMenuLabel(exec, execVid){
- var kinds = new Array("ilx_statumg", "ilx_ctxmg", "ilx_toolmg");
- for (c = 0; c < kinds.length; c ++ ){
- menuk = kinds[c];
- if (document.getElementById(menuk)){
- ilx_removeChildrenFromNode(document.getElementById(menuk));
- if (exec == "mu"){
- barmus = document.createElement("menuitem");
- barmus.setAttribute("label", ilx_lang.stream_label);
- barmus.addEventListener("click", ilx_get_mu_download, true);
- barmus.setAttribute("id", "stat_mus");
- document.getElementById(menuk).appendChild(barmus);
- barmudl = document.createElement("menuitem");
- barmudl.setAttribute("label", ilx_lang.download_label);
- barmudl.addEventListener("click", ilx_get_mu_download, true);
- barmudl.setAttribute("id", "stat_mudl");
- document.getElementById(menuk).appendChild(barmudl);
- }
- else if (exec == "rs" || exec == "mv" || exec == "mp" || exec == "veoh" || exec ==
- "noveoh" || exec == "df" || exec == "4s"){
- barp = document.createElement("menuitem");
- barp.setAttribute("label", ilx_lcz(ilx_lang.rmvLimit_label, ilx_fullname[exec]));
- barp.addEventListener("click", function (){
- ilx_sidebarClick(exec, execVid);
- }
- , true);
- barp.setAttribute("id", "stat_limit");
- document.getElementById(menuk).appendChild(barp);
- }
- else if (exec == "captcha"){
- barcapt = document.createElement("menuitem");
- barcapt.setAttribute("label", ilx_lang.captcha_label);
- document.getElementById(menuk).appendChild(barcapt);
- }
- else if (exec == "rs1"){
- barrs1 = document.createElement("menuitem");
- barrs1.setAttribute("label", "Select \"free\" option");
- barrs1.addEventListener("click", function (){
- window.content.document.getElementById("ff").submit();
- }
- , true);
- document.getElementById(menuk).appendChild(barrs1);
- }
- barpref = document.createElement("menuitem");
- barpref.setAttribute("label", "Preferences");
- barpref.setAttribute("oncommand", "ilx_openPref()");
- barpref.setAttribute("id", "stat_preferences");
- document.getElementById(menuk).appendChild(barpref);
- }
- }
- }
- function ilx_setTextBox(args){
- if (window.content.document.getElementById("alertTab_")){
- ilx_clear_addTxt(window.content.document.getElementById("alertTab_"), args);
- }
- }
- function ilx_sidebarClick(exec, execVid){
- if (exec == "mv"){
- ilx_get_mv(execVid);
- }
- else if (exec == "mp"){
- ilx_get_mp(execVid);
- }
- else if (exec == "captcha"){
- ilx_focuscaptcha();
- }
- else if (exec == "mu"){
- ilx_get_mu_stream();
- }
- else if (exec == "mud"){
- ilx_get_mu_download();
- }
- else if (exec == "veoh"){
- ilx_get_veoh(execVid);
- }
- else if (exec == "rs"){
- ilx_get_rs();
- }
- }
- function ilx_showAlert(kindArgs, vidArgs){
- exec = "";
- execVid = vidArgs;
- if (!window.content.document.getElementById("_ilx_alertShown_")){
- var walo = new Array;
- return walo;
- }
- if (window.content.document.getElementById("_ilx_alertShown_").value == kindArgs + "" +
- vidArgs){
- var walo = new Array;
- return walo;
- }
- loch = window.content.document.location.href.toLowerCase();
- window.content.document.getElementById("_ilx_alertShown_").value = kindArgs + "" +
- vidArgs;
- window.content.document.body.appendChild(prv);
- if (kindArgs == "megavideo"){
- exec = "mv";
- ilx_lastLabel = ilx_lcz(ilx_lang.rmvLimit_label, "MegaVideo");
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "megaporn"){
- exec = "mp";
- ilx_lastLabel = ilx_lcz(ilx_lang.rmvLimit_label, "MegaPorn");
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "veoh"){
- exec = "veoh";
- ilx_lastLabel = ilx_lcz(ilx_lang.rmvLimit_label, "Veoh");
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "captcha"){
- exec = "captcha";
- ilx_lastLabel = ilx_lang.captcha_label;
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "mu"){
- exec = "mu";
- ilx_lastLabel = ilx_lang.stream_label;
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "zs"){
- exec = "zs";
- ilx_lastLabel = ilx_lang.stream_label;
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "df"){
- exec = "df";
- ilx_lastLabel = ilx_lang.stream_label;
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "4s"){
- exec = "4s";
- ilx_lastLabel = ilx_lang.stream_label;
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "rs"){
- exec = "rs";
- ilx_lastLabel = ilx_lcz(ilx_lang.rmvLimit_label, "Rapidshare");
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else if (kindArgs == "rs1"){
- exec = "rs1";
- document.getElementById("ilx_mgttext").setAttribute("status", "has_items");
- }
- else {
- exec = "";
- }
- if (exec != ""){
- if (ilx_prefsBranch.getBoolPref("ilx_pref_pt_" + exec) == true){
- ilx_setMenuLabel(exec, execVid);
- if (ilx_prefsBranch.getBoolPref("ilx_pref_auto")){
- ilx_sidebarClick(exec, execVid);
- }
- else {
- if (ilx_prefsBranch.getBoolPref("ilx_pref_box")){
- if (exec != "captcha" && exec != "rs1"){
- ilx_makeAlert(exec, execVid);
- }
- }
- }
- if (exec == "captcha"){
- ilx_showcapt();
- }
- }
- }
- }
- function ilx_makeAlert(exec, execVid){
- bd = window.content.document.body;
- var embeds = window.content.document.getElementsByTagName("embed");
- for (e = 0; e < embeds.length; e ++ ){
- embeds[e].setAttribute("wmode", "opaque");
- embeds[e].src = embeds[e].src;
- }
- ilx_removeAlert();
- alrBox = document.createElement("div");
- alrBox.setAttribute("id", "alrBox");
- alrBox.setAttribute("style", "
- z-index:99995;position:fixed;right:10px;color:#FFF;font-size:11px;font-family:Arial;bottom
- :0px;width:295px;height:110px;background:transparent url('chrome://illimitux/skin/ff_box.p
- ng') no-repeat 0px 0px;");
- bd.appendChild(alrBox);
- lbox = window.content.document.getElementById("alrBox");
- alr = document.createElement("div");
- alr.setAttribute("id", "alertTab_");
- alr.setAttribute("style", "margin-left:67px; margin-top:32px; margin-right:5px;");
- alr.appendChild(document.createTextNode(ilx_lcz(ilx_lang.detects_lb, ilx_fullname[exec
- ])));
- alrcls = document.createElement("div");
- alrcls.setAttribute("id", "alertclose_");
- alrcls.addEventListener("click", ilx_removeAlert, true);
- alrcls.setAttribute("style", "
- z-index:99999;position:fixed;right:15px;bottom:87px;width:23px;height:23px;cursor:pointer;
- background:transparent url('chrome://illimitux/skin/ff_close.png') no-repeat;");
- if (exec == "mu" || exec == "zs" || exec == "df" || exec == "4s"){
- alrbtn = document.createElement("div");
- alrbtn.setAttribute("id", "alertbtn_");
- alrbtn.setAttribute("style", "
- z-index:99999;text-align:center;position:fixed;right:15px;bottom:37px;width:127px;height:1
- 7px;line-height:17px;cursor:pointer;color:#FFF;font-size:11px;font-family:Arial;background
- :transparent url('chrome://illimitux/skin/ff_btnmu.png') no-repeat;");
- alrlink1 = document.createElement("div");
- alrlink1.addEventListener("click", eval("ilx_get_" + exec + "_download"), true);
- alrlink1.appendChild(document.createTextNode(ilx_lang.dwld_lb));
- alrbtn.appendChild(alrlink1);
- alrlink2 = document.createElement("div");
- alrlink2.addEventListener("click", eval("ilx_get_" + exec + "_stream"), true);
- alrlink2.appendChild(document.createTextNode(" " + ilx_lang.stream_lb));
- alrbtn.appendChild(document.createTextNode(" | "));
- alrbtn.appendChild(alrlink2);
- }
- else {
- alrbtn = document.createElement("div");
- alrbtn.setAttribute("id", "alertbtn_");
- alrbtn.addEventListener("click", function (){
- ilx_sidebarClick(exec, execVid);
- }
- , true);
- alrbtn.setAttribute("style", "
- z-index:99999;text-align:center;position:fixed;right:15px;bottom:37px;width:127px;height:1
- 7px;line-height:17px;cursor:pointer;color:#FFF;font-size:11px;font-family:Arial;background
- :transparent url('chrome://illimitux/skin/ff_btn.png') no-repeat;");
- alrbtn.appendChild(document.createTextNode(ilx_lcz(ilx_lang.rmvLimit_label, "") + " "
- ));
- }
- alrpref = document.createElement("div");
- alrpref.setAttribute("id", "alertpref_");
- alrpref.addEventListener("click", ilx_openPref, true);
- alrpref.setAttribute("style", "
- z-index:99999;text-align:center;position:fixed;right:40px;bottom:92px;width:65px;height:14
- px;line-height:14px;cursor:pointer;color:#789CD8;font-size:10px;font-family:Arial;");
- alrpref.appendChild(document.createTextNode("Preferences"));
- alrauto = document.createElement("div");
- alrauto.setAttribute("id", "alertauto_");
- alrauto.setAttribute("style", "
- z-index:99999;text-align:center;position:fixed;right:163px;bottom:10px;width:135px;height:
- 20px;line-height:14px;cursor:pointer;color:#C0C0C0;font-size:10px;font-family:Arial;");
- alrauto.addEventListener("click", function (){
- ilx_prefsBranch.setBoolPref("ilx_pref_auto", true);
- ilx_sidebarClick(exec, execVid);
- }
- , true);
- alrauto.appendChild(document.createTextNode(ilx_lang.debriderAuto_box));
- alrdisable = document.createElement("div");
- alrdisable.setAttribute("id", "alertarmv_");
- alrdisable.setAttribute("style", "
- z-index:99999;text-align:center;position:fixed;right:20px;bottom:10px;width:135px;height:2
- 0px;line-height:14px;cursor:pointer;color:#C0C0C0;font-size:10px;font-family:Arial;");
- alrdisable.addEventListener("click", function (){
- ilx_prefsBranch.setBoolPref("ilx_pref_box", false);
- ilx_removeAlert();
- }
- , true);
- alrdisable.appendChild(document.createTextNode(ilx_lang.dont_box));
- lbox.appendChild(alrbtn);
- lbox.appendChild(alrdisable);
- lbox.appendChild(alrauto);
- lbox.appendChild(alrcls);
- lbox.appendChild(alr);
- lbox.appendChild(alrpref);
- }
- function ilx_removeAlert(){
- if (window.content.document.getElementById("alrBox")){
- window.content.document.body.removeChild(window.content.document.getElementById(
- "alrBox"));
- }
- }
- function ilx_openPref(){
- prefWin = window.openDialog("chrome://illimitux/content/preferences.xul",
- "Illimitux Preferences", "chrome,titlebar,toolbar,centerscreen,resizable");
- prefWin.focus();
- }
- function ilx_backuproxy(){
- ilx_bkproxy(false);
- alert(ilx_lang.proxy_restored);
- document.getElementById("current_proxy").value = ilx_prefsCom.getCharPref(
- "network.proxy.http") + ":" + ilx_prefsCom.getIntPref("network.proxy.http_port");
- }
- function ilx_changelang(args){
- alert(ilx_lang.update_lang);
- ilx_prefsBranch.setCharPref("locale", args);
- }
- function ilx_pref_load(){
- document.getElementById("ilx_pref_mkdon").label = ilx_lang.mkdon_lb;
- document.getElementById("ilx_pref_aide").label = ilx_lang.help_lb;
- document.getElementById("lang_label_activate").value = ilx_lang.lang_label_activate;
- document.getElementById("lang_label_general").value = ilx_lang.lang_label_general;
- document.getElementById("lang_label_langue").value = ilx_lang.lang_label_langue;
- document.getElementById("desc_recommended").value = ilx_lang.desc_recommended;
- document.getElementById("lang_button_backup").label = ilx_lang.lang_button_backup;
- document.getElementById("tab_label_general").label = ilx_lang.lang_label_general;
- document.getElementById("tab_label_about").label = ilx_lang.lang_label_about;
- document.getElementById("tab_label_plateforms").label = ilx_lang.lang_label_plateforms;
- document.getElementById("current_proxy").value = ilx_prefsCom.getCharPref(
- "network.proxy.http") + ":" + ilx_prefsCom.getIntPref("network.proxy.http_port");
- locale = ilx_prefsBranch.getCharPref("locale");
- elemL = document.getElementById("ilx_langPop").value = locale;
- var prefe = new Array("auto", "box", "embed", "tab", "referer", "zapmu", "rs", "proxy",
- "divx", "captcha", "pt_mv", "pt_mu", "pt_mp", "pt_rs", "pt_veoh", "pt_4s", "pt_zs");
- for (p = 0; p < prefe.length; p ++ ){
- if (document.getElementById("ilx_pref_" + prefe[p])){
- document.getElementById("ilx_pref_" + prefe[p]).checked = ilx_prefsBranch.
- getBoolPref("ilx_pref_" + prefe[p]);
- if (ilx_lang["pref_" + prefe[p] + "_lb"]){
- document.getElementById("ilx_pref_" + prefe[p]).label = ilx_lang["pref_" + prefe[
- p] + "_lb"];
- }
- }
- }
- }
- function ilx_tooglepref(args){
- ilx_prefsBranch.setBoolPref("ilx_pref_" + args, document.getElementById("ilx_pref_" +
- args).checked);
- }
- function ilx_welcome(){
- var win = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(
- Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser");
- win.openUILinkIn(ilx_uu + "welcome/" + ilx_lang.lang + "/" + ilx_vers + "/", "tab");
- ilx_prefsBranch.setBoolPref("ilx_firsttime_" + ilx_vers + "_", false);
- }
- function ilx_updateIcon_frm(){
- ilx_framesnotChanged = false;
- ilx_updateIcon();
- }
- function ilx_hitch(obj, meth){
- if (!obj[meth]){
- throw "method '" + meth + "' does not exist on object '" + obj + "'";
- }
- var staticArgs = Array.prototype.splice.call(arguments, 2, arguments.length);
- return function (){
- var args = Array.prototype.slice.call(staticArgs);
- Array.prototype.push.apply(args, arguments);
- return obj[meth].apply(obj, args);
- }
- ;
- }
- function ilx_injectScript(scripts, url, unsafeContentWin){
- var sandbox, xmlhttpRequester;
- var safeWin = new XPCNativeWrapper(unsafeContentWin);
- var safeDoc = safeWin.document;
- xmlhttpRequester = new ilx_xmlhttpRequester(unsafeContentWin, window);
- sandbox = new Components.utils.Sandbox(safeWin);
- sandbox.window = safeWin;
- sandbox.document = sandbox.window.document;
- sandbox.unsafeWindow = unsafeContentWin;
- sandbox.__proto__ = sandbox.window;
- sandbox.GM_xmlhttpRequest = ilx_hitch(xmlhttpRequester, "contentStartRequest");
- var scriptSrc = ilx_getUrlContents(scripts);
- Components.utils.evalInSandbox("(function(){" + scriptSrc + "})()", sandbox);
- }
- function ilx_bkproxy(ret){
- if (ilx_prefsBranch.getCharPref("illimitux_last_http").indexOf("illimitux") != "-1"){
- typeBK = "backup";
- }
- else {
- typeBK = "last";
- }
- ilx_prefsCom.setCharPref("network.proxy.http", ilx_prefsBranch.getCharPref("illimitux_" +
- typeBK + "_http"));
- ilx_prefsCom.setIntPref("network.proxy.http_port", ilx_prefsBranch.getIntPref(
- "illimitux_" + typeBK + "_port"));
- ilx_prefsCom.setIntPref("network.proxy.type", ilx_prefsBranch.getIntPref("illimitux_" +
- typeBK + "_type"));
- window.clearTimeout(ilx_Backup_Time_second);
- window.clearTimeout(ilx_Backup_Time);
- if (ret){
- reds = window.content.document.location.href.split("proxy/?r=");
- if (reds[1]){
- red = reds[1].split("&");
- window.content.document.location.href = unescape(red[0]);
- }
- else {
- window.content.history.go( - 1);
- }
- }
- }
- function ilx_divx(a, b){
- urlp = ilx_uu + "video/" + ilx_vers + "/divx/divx/?k=" + ilx_convert(ilx_linkDivx);
- ilx_openTab(urlp);
- }
- function ilx_detectDivx(){
- ilx_linkDivx = "";
- document.getElementById("illimitux-divxctx").label = ilx_lang.view_divx;
- document.getElementById("illimitux-divxctx").hidden = true;
- if (gContextMenu.onLink || gContextMenu.isTextSelected){
- if (gContextMenu.isTextSelected){
- var r = content.getSelection().getRangeAt(0);
- if (r){
- var div = r.startContainer.ownerDocument.createElement("div");
- div.appendChild(r.cloneContents());
- ilx_linkDivx = div.innerHTML;
- }
- else {
- ilx_linkDivx = selection.toString();
- }
- }
- else {
- ilx_linkDivx = gContextMenu.getLinkURL();
- }
- if (ilx_linkDivx.match(/^http/) && ilx_linkDivx.match(
- /(megaupload|avi|file|dl|mkv|divx|download|get|play|load)/g)){
- document.getElementById("illimitux-divxctx").hidden = false;
- }
- }
- else {
- document.getElementById("illimitux-divxctx").hidden = true;
- }
- }
- function ilx_updateIcon(){
- if (!window.content){
- return false;
- }
- if (window.content.document.getElementById("_ilx_updateIcon_") && ilx_framesnotChanged ==
- true ){
- return false;
- }
- else {
- ilx_framesnotChanged = true;
- loch = window.content.document.location.href.toLowerCase();
- prv = window.content.document.createElement("div");
- prv.id = "_ilx_updateIcon_";
- if (window.content.document.body){
- window.content.document.body.appendChild(prv);
- }
- if (!window.content.document.getElementById("_ilx_alertShown_")){
- pdrv = window.content.document.createElement("input");
- pdrv.id = "_ilx_alertShown_";
- pdrv.type = "hidden";
- if (window.content.document.body){
- window.content.document.body.appendChild(pdrv);
- }
- }
- if (ilx_welcomed == false && ilx_prefsBranch.prefHasUserValue("ilx_firsttime_" +
- ilx_vers + "_") == false){
- setTimeout(ilx_welcome, 1000);
- ilx_welcomed = true;
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_rs") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_rs", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_box") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_box", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_auto") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_auto", false);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_divx") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_divx", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_referer") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_referer", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_proxy") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_proxy", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_zapmu") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_zapmu", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_captcha") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_captcha", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_embed") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_embed", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_tab") == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_tab", true);
- }
- if (ilx_prefsBranch.prefHasUserValue("ilx_mu_auto") == false){
- ilx_prefsBranch.setCharPref("ilx_mu_auto", "");
- }
- var pt_pref = new Array("pt_mv", "pt_mu", "pt_mp", "pt_rs", "pt_veoh", "pt_4s",
- "pt_zs", "pt_rs1", "pt_captcha");
- for (pv = 0; pv < pt_pref.length; pv ++ ){
- if (ilx_prefsBranch.prefHasUserValue("ilx_pref_" + pt_pref[pv]) == false){
- ilx_prefsBranch.setBoolPref("ilx_pref_" + pt_pref[pv], true);
- }
- }
- ilx_setMenuLabel("", "");
- if (ilx_prefsBranch.prefHasUserValue("illimitux_backup_http") == false){
- ilx_prefsBranch.setCharPref("illimitux_backup_http", ilx_prefsCom.getCharPref(
- "network.proxy.http"));
- ilx_prefsBranch.setIntPref("illimitux_backup_port", ilx_prefsCom.getIntPref(
- "network.proxy.http_port"));
- ilx_prefsBranch.setIntPref("illimitux_backup_type", ilx_prefsCom.getIntPref(
- "network.proxy.type"));
- }
- if (ilx_prefsBranch.prefHasUserValue("illimitux_backup_referer") == false){
- ilx_prefsBranch.setIntPref("illimitux_backup_referer", ilx_prefsCom.getIntPref(
- "network.http.sendRefererHeader"));
- }
- if (loch.indexOf("illimitux.net/proxy/", 0) != "-1" && ilx_prefsCom.getCharPref(
- "network.proxy.http").indexOf("illimitux") != "-1"){
- ilx_bkproxy(true);
- }
- if (ilx_prefsBranch.getBoolPref("ilx_pref_referer") == true){
- ilx_prefsCom.setIntPref("network.http.sendRefererHeader", 0);
- }
- else {
- ilx_prefsCom.setIntPref("network.http.sendRefererHeader", ilx_prefsBranch.getIntPref
- ("illimitux_backup_referer"));
- }
- if (loch.indexOf("illimitux.net/video/", 0) != "-1" && window.content.document.
- getElementById("illimitux_streaming")){
- if (ilx_prefsBranch.getBoolPref("ilx_pref_proxy") == true){
- if (window.content.document.getElementById("illimitux_streaming").contentWindow.
- document.getElementById("server")){
- window.content.document.getElementById("illimitux_streaming").addEventListener(
- "load", ilx_updateIcon_frm, true);
- if (ilx_prefsCom.getCharPref("network.proxy.http").indexOf("illimitux") != "-1"
- ){
- ilx_bkproxy(false);
- }
- frmWind = window.content.document.getElementById("illimitux_streaming").
- contentWindow;
- var xhrP = new XMLHttpRequest;
- xhrP.open("GET", ilx_uu + "getproxy/" + ilx_convert(ilx_vers + "||mv||" +
- ilx_rand(0, 100000)) + "/", true);
- xhrP.setRequestHeader("Connection", "close");
- xhrP.onreadystatechange = function (){
- if (xhrP.readyState == 4){
- srvgetF = xhrP.responseText;
- Proxy = srvgetF.split("||");
- if (Proxy[1] != ""){
- if (Proxy[0] == 0){
- alert(ilx_lang.down_server);
- }
- else {
- if (Proxy[1] != ilx_prefsCom.getCharPref("network.proxy.http")){
- ilx_lastProx_http = ilx_prefsCom.getCharPref("network.proxy.http");
- ilx_lastProx_port = ilx_prefsCom.getIntPref("network.proxy.http_port"
- );
- ilx_lastProx_type = ilx_prefsCom.getIntPref("network.proxy.type");
- ilx_prefsBranch.setCharPref("illimitux_last_http", ilx_lastProx_http);
- ilx_prefsBranch.setIntPref("illimitux_last_port", ilx_lastProx_port);
- ilx_prefsBranch.setIntPref("illimitux_last_type", ilx_lastProx_type);
- ilx_prefsCom.setCharPref("network.proxy.http", Proxy[1]);
- ilx_prefsCom.setIntPref("network.proxy.http_port", Proxy[3]);
- ilx_prefsCom.setIntPref("network.proxy.type", Proxy[4]);
- ilx_Backup_Time_second = window.setTimeout(function (){
- ilx_bkproxy(false);
- }
- , 15000);
- frmWind.document.getElementById("server").value = Proxy[0];
- frmWind.document.getElementById("lastp").value = ilx_lastProx_http +
- ":" + ilx_lastProx_port;
- frmWind.document.getElementById("illimitux_gostream").submit();
- }
- }
- }
- }
- }
- ;
- xhrP.send(null);
- }
- }
- else {
- alert("Proxy switcher is disabled on preferences. Please activate it... ");
- }
- }
- if (loch.indexOf("illimitux.net/video/", 0) != "-1" && window.content.document.
- getElementById("illimitux_streaming") && ilx_prefsBranch.getBoolPref("ilx_pref_proxy")
- == true){
- if (window.content.document.getElementById("illimitux_streaming").contentWindow.
- document.getElementById("illimitux_loaded")){
- frmWind = window.content.document.getElementById("illimitux_streaming").
- contentWindow;
- ilx_Backup_Time = window.setTimeout(function (){
- ilx_bkproxy(false);
- }
- , 10000);
- }
- }
- if (loch.indexOf("megavideo.com", 0) != "-1" && (loch.indexOf("v=", 0) != "-1" || loch
- .indexOf("d=", 0) != "-1")){
- pageCtn = ilx_getCnt();
- vb = pageCtn.split(".v = \"");
- if (vb[1]){
- vb2 = vb[1].split("\"");
- v = vb2[0];
- }
- else {
- v = "";
- }
- lc = window.content.document.location.href.split("v=");
- if (!lc[1]){
- lc[1] = v;
- }
- if (lc[1]){
- vidmv = lc[1].substring(0, 8);
- ilx_showAlert("megavideo", vidmv);
- }
- }
- else if (loch.indexOf("megaporn.com", 0) != "-1" && (loch.indexOf("v=", 0) != "-1" ||
- loch.indexOf("d=", 0) != "-1")){
- pageCtn = ilx_getCnt();
- vb = pageCtn.split(".v = \"");
- if (vb[1]){
- vb2 = vb[1].split("\"");
- v = vb2[0];
- }
- else {
- v = "";
- }
- lc = window.content.document.location.href.split("v=");
- if (!lc[1]){
- lc[1] = v;
- }
- if (lc[1]){
- vidmv = lc[1].substring(0, 8);
- ilx_showAlert("megaporn", vidmv);
- }
- }
- else if (ilx_prefsBranch.getBoolPref("ilx_pref_zapmu") == true && window.content.
- document.getElementById("captchaform") && loch.indexOf("megaupload.com", 0) != "-1"){
- if (ilx_prefsBranch.getBoolPref("ilx_pref_pt_mu") == true){
- ilx_attachMU();
- }
- }
- else if (window.content.document.getElementById("captchaform") && loch.indexOf(
- "megaupload.com", 0) != "-1"){
- ilx_showAlert("captcha", false);
- }
- else if (window.content.document.getElementById("downloadlink") && loch.indexOf(
- "megaupload.com", 0) != "-1"){
- workMu();
- }
- else if (window.content.document.getElementById("download") && loch.indexOf(
- "zshare.net", 0) != "-1"){
- if (window.content.document.forms[0]){
- window.content.document.forms[0].submit();
- }
- else {
- ilx_showAlert("zs", false);
- }
- }
- else if ((window.content.document.getElementById("divDLStart") || window.content.
- document.getElementById("fileNameText")) && loch.indexOf("4shared.com", 0) != "-1"){
- if (window.content.document.location.href.indexOf("file/", 0) != "-1"){
- window.content.document.location.href = window.content.document.location.href.
- split("file").join("get");
- }
- else {
- ilx_showAlert("4s", false);
- }
- }
- else if (window.content.document.getElementById("box_big") && loch.indexOf(
- "depositfiles.com", 0) != "-1"){
- if (window.content.document.forms[1].action.indexOf("files/", 0) != "-1"){
- window.content.document.forms[1].submit();
- }
- else {
- ilx_showAlert("df", false);
- }
- }
- else if (loch.indexOf("veoh.com", 0) != "-1"){
- pageCtn = ilx_getCnt();
- lhref = window.content.document.location.href;
- if (lhref.indexOf("illimitux.net", 0) != "-1"){
- lhref = unescape(lhref);
- }
- dvs = lhref.split("watch%3D");
- if (!dvs[1]){
- dvs = lhref.split("watch/");
- }
- if (!dvs[1]){
- dvs = lhref.split("videos/");
- }
- if (dvs[1]){
- tempE = dvs[1].split("#");
- temp = tempE[0];
- tempsd = temp.split("&");
- tempd = tempsd[0];
- ilx_showAlert("veoh", tempd);
- }
- }
- else if (loch.indexOf("rapidshare.com/files", 0) != "-1" && window.content.document.
- getElementById("dl")){
- if (ilx_prefsBranch.getBoolPref("ilx_pref_pt_rs") == true){
- if (ilx_prefsBranch.getBoolPref("ilx_pref_rs")){
- ilx_get_rs();
- }
- else {
- ilx_showAlert("rs", false);
- }
- }
- }
- else if (loch.indexOf("rapidshare.com/files", 0) != "-1" && window.content.document.
- getElementById("ff")){
- if (ilx_prefsBranch.getBoolPref("ilx_pref_pt_rs") == true){
- if (ilx_prefsBranch.getBoolPref("ilx_pref_rs")){
- window.content.document.getElementById("ff").submit();
- }
- else {
- ilx_showAlert("rs1", false);
- }
- }
- }
- else {
- if (ilx_prefsBranch.getBoolPref("ilx_pref_embed")){
- if (loch.indexOf("illimitux.net", 0) == "-1"){
- var aly = ilx_analyseEmbed();
- if (aly.length > 0){
- delm = loch.split("/");
- ilx_firstLoch = delm[2].replace("www.", "");
- ilx_showAlert(aly[0].kind, aly[0].vid);
- }
- else {
- document.getElementById("ilx_mgttext").setAttribute("status", "no_items");
- ilx_showAlert(false, false);
- }
- }
- else {
- document.getElementById("ilx_mgttext").setAttribute("status", "no_items");
- ilx_showAlert(false, false);
- }
- }
- else {
- document.getElementById("ilx_mgttext").setAttribute("status", "no_items");
- ilx_showAlert(false, false);
- }
- }
- }
- }
- window.addEventListener("load", function (){
- if (document.getElementById("contentAreaContextMenu")){
- document.getElementById("contentAreaContextMenu").addEventListener("popupshowing",
- ilx_detectDivx, false);
- }
- }
- , false);
- window.addEventListener("DOMContentLoaded", function (){
- if (typeof gBrowser != "undefined"){
- if (typeof gBrowser.tabContainer != "undefined"){
- gBrowser.tabContainer.addEventListener("load", ilx_updateIcon, true);
- gBrowser.tabContainer.addEventListener("TabSelect", ilx_updateIcon, true);
- }
- }
- else {
- window.addEventListener("load", ilx_updateIcon, true);
- }
- }
- , true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement