# Greasify 0.7.9.3.6.20080814(http://www.digivill.net/~joykillr/kmeleon/kmeleon_userscripts.html)
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# ---------- Greasify Macro ------------------------------------------------------------------------------------
#
# Dependencies : main.kmm ($macroPrefBranch, JS)
# Resources : -
# Preferences : kmeleon.plugins.macros.greasify
# kmeleon.plugins.macros.greasify.userscript[1-499]
# kmeleon.plugins.macros.greasify.scripts.active
#
# ------------------------------------------------------------------------------------------------------------------
Greasify_MainStart{
$g_LOCALPATH = getpref(STRING,$_Greasify_Custom.".directory");
$g_LOCALPATH = $g_LOCALPATH==""? (getfolder(UserMacroFolder))."\\greasify\\uscripts" : $g_LOCALPATH;
#index((basename($URL)),".user.js")!=-1? &Greasify_LoadScriptFromWeb:0;
$g_scripts = ""; $includeURL = ""; $excludeURL = "";
$g_HOST = hostname( $URL );
$g_hostLen = length($g_HOST);
$xtotal = getpref(INT,$_Greasify_Custom.".scripttotal"); $xmain = 1;
$g_hostLen==0 ? $xmain = 499:0;
$xname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain);
$xnameLEN = length($xname);
$activeURL = $URL; $schmchk = "";
$schmidx = 0; $schmidx = index($activeURL,"\:\/\/");
$schmchk = $schmidx>0 ? substr($activeURL,0,$schmidx): $schmchk;
$xnameLEN = index($schmchk,"tp")>0? $xnameLEN : 0;
$nscompat = getpref(BOOL,$_Greasify_Custom.".nscompat");
$nscompat==true?$siteAllowed = getpref(STRING, "capability.policy.maonoscript.sites"):0;
$nscompat==true?$nsGlobalReady = getpref(BOOL,"noscript.global"):0;
while ($xnameLEN != 0) &Greasify_CodeChkNEW;
setpref(STRING,$_Greasify_Custom.".scripts.active", $g_scripts);
}
Greasify_GoGrease{
$_greasify_considerDupWorkAround = 1;
&Greasify_MainStart;
#index(hostname($URL),"userscripts.org")==-1 ? &Greasify_MainStart:0;
$USORG = index(hostname($URL),"userscripts.org")!=-1 ? "true" : "false";
#$USORG!="true"? &Greasify_MainStart : index(basename($URL),".user.js")!=-1? &Greasify_LoadScriptFromWebStart : &Greasify_MainStart;
$USORG=="true"? $scriptBase = basename($URL) : 0;
#$USORG!="true"? &Greasify_MainStart : index($scriptBase,".user.js")!=-1? &Greasify_LoadScriptFromWebStart : &Greasify_MainStart;
$USORG!="true"? 0 : index($scriptBase,".user.js")==-1 ? 0 : &Greasify_LoadScriptFromWebStart;
}
Greasify_CodeChkNEW{
$z = 0;
$NS = getpref(STRING,$_Greasify_Custom.".userscript".$xmain.".name");
$QQe = getpref(INT,$_Greasify_Custom.".userscript".$xmain.".exclude.total");
$Qq = 1;
while ($Qq <= $QQe) &Greasify_CodeChkNEWExcludes;
$includeURL = "";
$QQi = getpref(INT,$_Greasify_Custom.".userscript".$xmain.".include.total");
$Qq = 1;
$QQi = $z>0? 0 : $QQi;
$z = 0;
$Qname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain.".include.1");
$QnameLEN = length($Qname);
$QnameLEN = $QQi<=0 ? 0 : length($Qname);
while ($QnameLEN > 0) &Greasify_CodeChkNEWIncludes;
$nsChk = $nscompat==true ? index($siteAllowed, " ".$g_HOST." ") : -1;
$z>=1 ? &Greasify_NewInjectJS:0;
$xmain = $xmain + 1;
$xname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain);
$xnameLEN = length($xname);
}
Greasify_CodeChkNEWIncludes{
$strAeval = -1; $ftpEval = -1; $secEval = -1; $strStartLoc = -1; $includeURL = ""; $nextIncludeURL = "";
$includeURL = getpref(STRING,$_Greasify_Custom.".userscript".$xmain.".include.".$Qq);
&Greasify_GHostChkSevenAssist2;
$nextIncludeURL = getpref(STRING,$_Greasify_Custom.".userscript".$xmain.".include.".$Qq);
$QnameLEN = length($nextIncludeURL);
}
Greasify_CodeChkNEWExcludes{
$strAeval = -1; $ftpEval = -1; $secEval = -1; $strStartLoc = -1; $excludeURL = "";
$excludeURL = getpref(STRING,$_Greasify_Custom.".userscript".$xmain.".exclude.".$Qq);
&Greasify_GExcludeAssist2;
}
Greasify_ExcludeChk{
&Greasify_ExcludeChk1;
&Greasify_ExcludeChk2;
}
Greasify_InjectJS{
$_greasify_considerDupWorkAround==1 ? $con2 = "if \(\!document.getElementById\(\'verifygreasify\'\)\)\{"."\n".$con2."\n"."\}" : 0;
#$con2 = $_greasify_considerDupWorkAround==1 ? "if \(\!document.getElementById\(\'verifygreasify\'\)\)\{"."\n".$con2."\n"."\}" : $con2;
$nsGlobalReady3 = getpref(STRING,"capability.policy.default.javascript.enabled");
$nsGlobalReady3=="noAccess" ? &NoScriptCompatApplyOn:0;
injectJS($con2);
$nsGlobalReady3=="noAccess" ? &NoScriptCompatApplyOff:0;
$sbgo = getpref(INT,$_Greasify_Custom.".statusbarmsg");
$z<1 ? $z = $z : $sbgo<1 ? $z = $z : statusbar("***Userscript Applied: ".$NS);
$z>=1? $g_scripts = $g_scripts."\n\n".$NS." \(".$xname."\)"."\n" : $z = $z;
$vchk = ""; $vchk = getpref(BOOL,$_Greasify_Custom.".copyclipboard");
$vchk==true ? setclipboard($con2) : 0;
}
Greasify_tagPageAsDone{
injectJS("var greasydiv = document.createElement('div'); document.body.appendChild(greasydiv); greasydiv.id = 'verifygreasify'; greasydiv.innerHTML = ''; greasydiv.style='visibility\:hidden\;';");
}
Greasify_Chk2{
$checkBeginning = ""; $checkEnding = "";
$hstrun = "\^".$hstrun;
$checkBeginning = index($hstrun,"\^\*");
$checkBeginning!=-1? $hstrun = gsub("\^\*.", "", $hstrun):0;
$checkBeginning!=-1? $hstrun = gsub("\^\*", "", $hstrun):0;
$checkBeginning==-1? $hstrun = substr($hstrun,1):0;
$gocount = 6; $checkEnding = 0;
$USidx = length($hstrun); $USidx = $USidx - 1;
length($hstrun)<1? $gocount = 0:0;
$checkBeginning!=-1? $checkBeginning = 1:0;
#$USidx>0? while ($gocount > 0) &Greasify_HostCheckHelper:0;
$USidx>0? $atest = "TRUE" : $atest = "FALSE";
##while ($atest = "TRUE") &Greasify_HostCheckHelperK15;
$atest=="TRUE"? &Greasify_HostCheckHelperK15 : $atest = $atest;
$checkBeginning!=1? 0 : $checkEnding!=1? 0 : $theMeth = "BeginStarEndStar";
$checkBeginning!=1? 0 : $checkEnding==1? 0 : $theMeth = "BeginStarEnd";
$checkBeginning==1? 0 : $checkEnding==1? 0 : $theMeth = "BeginEnd";
$checkBeginning==1? 0 : $checkEnding!=1? 0 : $theMeth = "BeginEndStar";
$thirdStar = index($hstrun,"\*")!=-1 ? "true" : "false";
$activeURLsecEval = -1; $activeURLftpEval = -1; $activeURLeval = -1; $activeSecEvalIndex = -1; $activeftpEvalIndex = -1;
$activeURLeval = index($activeURL, "http:\/\/");
$activeSecEvalIndex = index($activeURL, "https:\/\/");
$activeftpEvalIndex = index($activeURL, "ftp:\/\/");
$activeURLeval==-1 ? $activeURLsecEval = $activeSecEvalIndex:0;
$activeURLeval!=-1 ? 0 : $activeURLsecEval!=-1 ? 0 : $activeURLftpEval = $activeftpEvalIndex;
$activeURLeval!=-1? $activeURLStartLoc = $activeURLeval + 7:0;
$activeURLsecEval!=-1? $activeURLStartLoc = $activeURLsecEval + 8:0;
$activeURLftpEval!=-1? $activeURLStartLoc = $activeURLftpEval + 6:0;
$activeURLeval==-1? 0 : $strAeval==-1? 0 : $thirdStar=="true"? 0:&Greasify_gEvalAll;
$activeURLeval==-1? 0 : $strAeval==-1? 0 : $thirdStar=="false"? 0:&Greasify_gEvalAllAlt;
$activeURLsecEval==-1? 0 : $secEval==-1? 0 : $thirdStar=="true"? 0:&Greasify_gEvalAll;
$activeURLsecEval==-1? 0 : $secEval==-1? 0 : $thirdStar=="false"? 0:&Greasify_gEvalAllAlt;
$activeURLftpEval==-1? 0 : $ftpEval==-1? 0 : $thirdStar=="true"? 0:&Greasify_gEvalAll;
$activeURLftpEval==-1? 0 : $ftpEval==-1? 0 : $thirdStar=="false"? 0:&Greasify_gEvalAllAlt;
}
Greasify_HostCheckHelperK15{
while ($gocount > 0) &Greasify_HostCheckHelper;
$atest = "FALSE";
}
Greasify_gEvalAll{
$activeURLLength = length($activeURL); $hstrunLength = length($hstrun);
$theMeth=="BeginStarEndStar" ? &Greasify_gEvalAll_BeginStarEndStar : 0;
$theMeth=="BeginEndStar" ? &Greasify_gEvalAll_BeginEndStar : 0;
$theMeth=="BeginStarEnd" ? &Greasify_gEvalAll_BeginStarEnd : 0;
$theMeth=="BeginEnd" ? &Greasify_gEvalAll_BeginEnd : 0;
}
Greasify_gEvalAll_BeginStarEndStar{
$z = index($activeURL, $hstrun)!=-1 ? 1 : $z;
}
Greasify_gEvalAll_BeginEndStar{
$activeURL = substr($activeURL, $activeURLStartLoc);
$activeURL = substr($activeURL,0,$hstrunLength);
$z = $activeURL==$hstrun ? 1 : $z ;
}
Greasify_gEvalAll_BeginStarEnd{
$activeURL = substr($activeURL, $activeURLStartLoc);
$activeURLLength>$hstrunLength? $activeURLLength = $activeURLLength - $hstrunLength:0;
$activeURLLength>$hstrunLength? $activeURL = substr($activeURL, $activeURLLength):0;
$activeURLLength<$hstrunLength? $hstrunLength = $hstrunLength - $activeURLLength:0;
$activeURLLength<$hstrunLength? $hstrun = substr($hstrun, $hstrunLength):0;
$z = $activeURL==$hstrun ? 1 : $z ;
}
Greasify_gEvalAll_BeginEnd{
$activeURL = substr($activeURL, $activeURLStartLoc);
$z = $activeURL==$hstrun ? 1 : $z ;
}
Greasify_gEvalAllAlt{
$midIDX = index($hstrun,"\*"); $mid1 = substr($hstrun,0,$midIDX);
$midIDX = $midIDX + 1; $mid2 = substr($hstrun,$midIDX);
$mid1Length = length($mid1); $mid2Length = length($mid2);
$activeURLLength = length($activeURL); $hstrunLength = length($hstrun);
$theMeth=="BeginStarEndStar" ? Greasify_gEvalAllAlt_BeginStarEndStar:0;
$theMeth=="BeginEndStar" ? Greasify_gEvalAllAlt_BeginEndStar:0;
$theMeth=="BeginStarEnd" ? Greasify_gEvalAllAlt_BeginStarEnd:0;
$theMeth=="BeginEnd" ? Greasify_gEvalAllAlt_BeginEnd:0;
}
Greasify_gEvalAllAlt_BeginStarEndStar{
$btest = "";
#index($activeURL, $mid1)!=-1 ? index($activeURL, $mid2)!=-1 ? $z = 1 : $z = $z;
$btest = index($activeURL, $mid1);
$btest2 = index($activeURL, $mid2);
$btest==-1 ? $btest = $btest : $btest2==-1 ? $z = $z : $z = 1;
}
Greasify_gEvalAllAlt_BeginEndStar{
$btest = "";
$activeURLa = substr($activeURL,0,$mid1Length);
#$activeURLa==$mid1 ? index($activeURL, $mid2)!=-1 ? $z = 1 : $z = $z;
$btest = index($activeURL, $mid2);
$activeURLa!=$mid1 ? $z = $z : $btest==-1 ? $z = $z : $z = 1;
}
Greasify_gEvalAllAlt_BeginStarEnd{
$btest = "";
$activeURLLength = $activeURLLength - $mid2Length;
$activeURLb = substr($activeURL,$activeURLLength,$mid2Length);
#$activeURLb==$mid2 ? index($activeURL, $mid1)!=-1 ? $z = 1 : $z = $z;
$btest = index($activeURL, $mid1);
$activeURLb!=$mid2 ? $z = $z : $btest==-1 ? $z = $z : $z = 1;
}
Greasify_gEvalAllAlt_BeginEnd{
#$btest = "";
$activeURLa = substr($activeURL,0,$mid1Length);
$activeURLLength = $activeURLLength - $mid2Length;
$activeURLb = substr($activeURL,$activeURLLength,$mid2Length);
#$activeURLa==$mid1 ? $activeURLb==$mid2 ? $z = 1 : $z = $z;
#$btest = index($activeURL, $mid1);
$activeURLa!=$mid1 ? $z = $z : $activeURLb!=$mid2 ? $z = $z : $z = 1;
}
Greasify_HostCheckHelper{
$hstrunvchk = ""; $checkEnding = 0;
$USidx = $USidx - 1;
$hstrunvchk = substr($hstrun, $USidx);
$chkHstRun = index($hstrunvchk,"\.\*");
$chkHstRun = index($hstrunvchk,"\/\*");
$USidx = $USidx + 1;
$hstrunvchk = substr($hstrun, $USidx,1);
$chkHstRun!=-1 ? $USidx = $USidx - 1:0;
$hstrunvchk=="\*" ? $hstrun = substr($hstrun, 0, $USidx):0;
$hstrunvchk=="\*" ? $checkEnding = 1:0;
$hstrunvchk=="\*" ? $gocount = 0:0;
$gocount>0 ? $gocount = $gocount - 1:0;
$USidx = $USidx - 1;
}
Greasify_GHostChkSeven{
&Greasify_GHostChkSeven1;
&Greasify_GHostChkSeven2;
}
Greasify_GHostChkSeven1{
$strAeval = -1; $ftpEval = -1; $secEval = -1; $strStartLoc = -1;
$includeURL1st = ""; $includeURL2nd = ""; $includeURL3rd = ""; $includeURL4th = ""; $includeURL5th = ""; $includeURL6th = ""; $includeURL7th = ""; $includeURL8th = "";
$includeURL9th = ""; $includeURL10th = ""; $includeURL11th = ""; $includeURL12th = ""; $includeURL13th = ""; $includeURL14th = ""; $includeURL15th = ""; $includeURL16th = "";
$includeURL = "";
$includeAgain = -1; $includeTotal = -1;
$exChk2 = index($includeURLs,"\/\/\ \@exclude");
$exChk2>0? $includeURLs = substr($includeURLs,0,$exChk2):0;
$includeRunCount = 1;
while ($includeURLs!="") &Greasify_Isolate_Includes_Main;
}
Greasify_Isolate_Includes_Main{
&Greasify_Isolate_Includes_Proc;
$GIncWorkAround = index($workingIncURL,"\/\/ \@");
$workingIncURL = $GIncWorkAround==-1? $workingIncURL : substr($workingIncURL,0,$GIncWorkAround);
$includeTotal = $includeRunCount;
$includeURL1st = $includeRunCount==1? $workingIncURL : $includeURL1st;
$includeURL2nd = $includeRunCount==2? $workingIncURL : $includeURL2nd;
$includeURL3rd = $includeRunCount==3? $workingIncURL : $includeURL3rd;
$includeURL4th = $includeRunCount==4? $workingIncURL : $includeURL4th;
$includeURL5th = $includeRunCount==5? $workingIncURL : $includeURL5th;
$includeURL6th = $includeRunCount==6? $workingIncURL : $includeURL6th;
$includeURL7th = $includeRunCount==7? $workingIncURL : $includeURL7th;
$includeURL8th = $includeRunCount==8? $workingIncURL : $includeURL8th;
$includeURL9th = $includeRunCount==9? $workingIncURL : $includeURL9th;
$includeURL10th = $includeRunCount==10? $workingIncURL : $includeURL10th;
$includeURL11th = $includeRunCount==11? $workingIncURL : $includeURL11th;
$includeURL12th = $includeRunCount==12? $workingIncURL : $includeURL12th;
$includeURL13th = $includeRunCount==13? $workingIncURL : $includeURL13th;
$includeURL14th = $includeRunCount==14? $workingIncURL : $includeURL14th;
$includeURL15th = $includeRunCount==15? $workingIncURL : $includeURL15th;
$includeURL16th = $includeRunCount==16? $workingIncURL : $includeURL16th;
#$includeURLs = $includeRunCount>=8? "" : $includeURLs;
$includeRunCount = $includeRunCount + 1;
}
Greasify_Isolate_Includes_Proc{
$includeAgain = index($includeURLs,"\/\/ \@include");
$workingIncURL = $includeAgain!=-1 ? substr($includeURLs,$includeAgain+11) : $includeURLs;
$includeAgain = index($workingIncURL,"\/\/ \@include");
$includeURLs = $includeAgain!=-1 ? substr($workingIncURL,$includeAgain) : "";
}
Greasify_GHostChkSeven2{
$Qq = 1;
$QnameLEN = length($includeURL);
while ($QnameLEN > 0) &Greasify_GHostChkSevenAssist;
}
Greasify_GHostChkSevenAssist{
&Greasify_GHostChkSevenAssist1;
&Greasify_GHostChkSevenAssist2;
$QnameLEN = $Qq>=17? 0 : length($includeURL);
}
Greasify_GHostChkSevenAssist1{
$more = -1;
$includeURL = $Qq==1? $includeURL1st : $includeURL;
$includeURL = $Qq==2? $includeURL2nd : $includeURL;
$includeURL = $Qq==3? $includeURL3rd : $includeURL;
$includeURL = $Qq==4? $includeURL4th : $includeURL;
$includeURL = $Qq==5? $includeURL5th : $includeURL;
$includeURL = $Qq==6? $includeURL6th : $includeURL;
$includeURL = $Qq==7? $includeURL7th : $includeURL;
$includeURL = $Qq==8? $includeURL8th : $includeURL;
$includeURL = $Qq==9? $includeURL9th : $includeURL;
$includeURL = $Qq==10? $includeURL10th : $includeURL;
$includeURL = $Qq==11? $includeURL11th : $includeURL;
$includeURL = $Qq==12? $includeURL12th : $includeURL;
$includeURL = $Qq==13? $includeURL13th : $includeURL;
$includeURL = $Qq==14? $includeURL14th : $includeURL;
$includeURL = $Qq==15? $includeURL15th : $includeURL;
$includeURL = $Qq==16? $includeURL16th : $includeURL;
}
Greasify_GHostChkSevenAssist2{
&Greasify_GChkSevenProcessor;
$activeURL = $URL;
$activeURL = gsub("\n","",$activeURL); $activeURL = gsub("\t","",$activeURL);
&Greasify_Chk2;
$Qq = $z>=1 ? $QQi + 1: $Qq + 1;
}
Greasify_GChkSevenProcessor{
$strAeval = index($includeURL, "http:\/\/");
$secEvalIndex = index($includeURL, "https:\/\/");
$strAeval==-1 ? $secEval = $secEvalIndex:0;
$ftpEvalIndex = index($includeURL, "ftp:\/\/");
$strAeval!=-1 ? 0 : $secEval!=-1 ? 0 : $ftpEval = $ftpEvalIndex;
$strAeval!=-1? $strStartLoc = $strAeval + 7:0;
$secEval!=-1? $strStartLoc = $secEval + 8:0;
$ftpEval!=-1? $strStartLoc = $ftpEval + 6:0;
$strStartLoc!=-1? $includeURL = substr($includeURL, $strStartLoc):0;
#$includeURL = $strStartLoc!=-1? substr($includeURL, $strStartLoc):$includeURL;
$more = index($includeURL, "\/\/\ ");
$includeURL = $more>=1 ? substr($includeURL,0,$more) : $includeURL;
$hstrun = $includeURL;
}
Greasify_ExcludeChk1{
$strAeval = -1; $ftpEval = -1; $secEval = -1; $strStartLoc = -1;
$excludeURL1st = ""; $excludeURL2nd = ""; $excludeURL3rd = ""; $excludeURL4th = ""; $excludeURL = ""; $excludeURL5th = ""; $excludeURL6th = ""; $excludeURL7th = ""; $excludeURL8th = "";
$excludeAgain = -1; $excludeTotal = -1;
$exChk1 = index($excludeURLs,"\/\/\ \@include");
$exChk1>0? $excludeURLs = substr($excludeURLs,0,$exChk1):0;
$excludeRunCount = 1;
while ($excludeURLs!="") &Greasify_Isolate_Excludes_Main;
}
Greasify_Isolate_Excludes_Main{
&Greasify_Isolate_Excludes_Proc;
$GExcWorkAround = index($workingExURL,"\/\/ \@");
$workingExURL = $GExcWorkAround==-1? $workingExURL : substr($workingExURL,0,$GExcWorkAround);
$excludeTotal = $excludeRunCount;
$excludeURL1st = $excludeRunCount==1? $workingExURL : $excludeURL1st;
$excludeURL2nd = $excludeRunCount==2? $workingExURL : $excludeURL2nd;
$excludeURL3rd = $excludeRunCount==3? $workingExURL : $excludeURL3rd;
$excludeURL4th = $excludeRunCount==4? $workingExURL : $excludeURL4th;
$excludeURL5th = $excludeRunCount==5? $workingExURL : $excludeURL5th;
$excludeURL6th = $excludeRunCount==6? $workingExURL : $excludeURL6th;
$excludeURL7th = $excludeRunCount==7? $workingExURL : $excludeURL7th;
$excludeURL8th = $excludeRunCount==8? $workingExURL : $excludeURL8th;
$excludeURLs = $excludeRunCount>=8? "" : $excludeURLs;
$excludeRunCount = $excludeRunCount + 1;
}
Greasify_Isolate_Excludes_Proc{
$excludeAgain = index($excludeURLs,"\/\/ \@exclude");
$workingExURL = $excludeAgain!=-1 ? substr($excludeURLs,$excludeAgain+11) : $excludeURLs;
$excludeAgain = index($workingExURL,"\/\/ \@exclude");
$excludeURLs = $excludeAgain!=-1 ? substr($workingExURL,$excludeAgain) : "";
}
Greasify_ExcludeChk2{
$Qq = 1;
while ($Qq <= $excludeTotal) &Greasify_GExcludeAssist;
$stop = $z>0 ? 1 : 0;
$z = 0; $includeURL = "";
}
Greasify_GExcludeAssist{
&Greasify_GExcludeAssist1;
&Greasify_GExcludeAssist2;
}
Greasify_GExcludeAssist1{
$more = -1;
$excludeURL = $Qq==1? $excludeURL1st : $excludeURL;
$excludeURL = $Qq==2? $excludeURL2nd : $excludeURL;
$excludeURL = $Qq==3? $excludeURL3rd : $excludeURL;
$excludeURL = $Qq==4? $excludeURL4th : $excludeURL;
$excludeURL = $Qq==5? $excludeURL5th : $excludeURL;
$excludeURL = $Qq==6? $excludeURL6th : $excludeURL;
$excludeURL = $Qq==7? $excludeURL7th : $excludeURL;
$excludeURL = $Qq==8? $excludeURL8th : $excludeURL;
}
Greasify_GExcludeAssist2{
$includeURL = $excludeURL;
&Greasify_GChkSevenProcessor;
$activeURL = $URL;
$activeURL = gsub("\n","",$activeURL); $activeURL = gsub("\t","",$activeURL);
&Greasify_Chk2;
$Qq = $Qq + 1;
}
Greasify_DelScript{
&Greasify_ScriptsActive;
$scrnum = prompt("Enter the number of the script you wish to remove:", "Select Script To Remove", "");
$scrnum!="" ? $scrtodel = getpref(STRING,$_Greasify_Custom.".userscript".$scrnum):$scrtodel = "";
$scrnum!="" ? $scrtodelName = getpref(STRING,$_Greasify_Custom.".userscript".$scrnum.".name"):$scrtodelName = "";
$scrnum!="" ? $confdel = confirm("Are you sure you wish to remove ".$scrtodelName." (".$scrtodel.")?", "Remove Script from Repository?", YESNO, QUESTION):$confdel = "NO";
$confdel=="YES" ? &Greasify_DelScriptCont:0;
}
Greasify_DelScriptCont{
$xmain = $count;
&Greasify_ClearIncExcPrefsProc;
$xmain = $scrnum;
$scrnum==$count? 0 : &Greasify_ClearIncExcPrefsProc;
statusbar("Done clearing include/exclude URLs.");
$scrtomov = getpref(STRING,$_Greasify_Custom.".userscript".$count);
setpref(STRING,$_Greasify_Custom.".userscript".$scrnum, $scrtomov);
setpref(STRING,$_Greasify_Custom.".userscript".$count, "");
$count = $count - 1;
setpref(INT,$_Greasify_Custom.".scripttotal", $count);
$xmain = $scrnum;
&Greasify_AddScriptPrefsGen;
}
Greasify_SetDir{
$g_FOLDERPATH = promptforfolder("Select Folder Containing User Scripts");
$g_FOLDERPATH=="" ? 0 : setpref(STRING,$_Greasify_Custom.".directory", $g_FOLDERPATH);
}
Greasify_ScriptsActive1{
$un = 1;
$count = getpref(INT,$_Greasify_Custom.".scripttotal");
$g_scripts = "";
$workpref = getpref(STRING,$_Greasify_Custom.".userscript1");
$preflen = length($workpref);
while ($preflen != 0) &Greasify_ScriptsActiveHelp;
}
Greasify_ScriptsActive2{
alert($g_scripts, "Userscripts In Repository", INFO);
}
Greasify_ScriptsActive{
&Greasify_ScriptsActive1;
&Greasify_ScriptsActive2;
}
Greasify_ScriptsInRepository{
$ztest = index($URLBAR,"about\:config");
$ztest = $ztest == -1 ? index($URLBAR,"chrome\:") : $z;
&Greasify_ScriptsActive1;
&Greasify_GetVersion;
$modalpref = getpref(BOOL,$_Greasify_Custom.".use_modal");
$ztest!=-1 ? 0 : $modalpref!=true ? &Greasify_ScriptsActive2:&Greasify_ScriptsInRepositoryContinue;
#$ztest!=-1 ? 0 : &Greasify_ScriptsInRepositoryContinue;
###$ztest!=-1 ? alert("Please open new tab/window first and try again","Cannot open list on top of about\:config or chrome\:\/\/ url",INFO):0;
#$ztest!=-1 ? $modalpref==true? alert("Please open new tab/window first and try again","Cannot open list on top of about\:config or chrome\:\/\/ urls.",INFO):0;
$ztest==-1 ? 0 : $modalpref!=true? 0 : alert("Please open new tab/window first and try again","Cannot open list on top of about\:config or chrome\:\/\/ urls.",INFO);
}
Greasify_ScriptsInRepositoryContinue{
#&Greasify_ScriptsActive1;
#&Greasify_GetVersion;
#$modalpref = getpref(BOOL,$_Greasify_Custom.".use_modal");
#$modalpref!=true ? &Greasify_ScriptsActive2:0;
$modalpref!=true ? 0 : $nsGlobalReady3 = getpref(STRING,"capability.policy.default.javascript.enabled");
$modalpref!=true ? 0 : $nsGlobalReady3=="noAccess" ? &Greasify_NoScriptCompatApplyOn:0;
$g_scripts = gsub("\n","
",$g_scripts);
$g_scripts = gsub("\t","\ \;\ \;\ \;\ \;\ \;",$g_scripts);
$g_scripts = gsub("(","\(",$g_scripts);
$g_scripts = gsub(")","\)",$g_scripts);
$modalpref==true ? injectJS("var greasifydiv = document.createElement('div'); document.body.appendChild(greasifydiv);greasifydiv.id = 'greasifydiv'; greasifydiv.innerHTML = '