# Greasify 0.7.9.2.20071129(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{ $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; } 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{ $nscompat!=true ? 0 : $nsChk!=-1 ? 0 : $nsGlobalReady==true ? 0 : &Greasify_NoScriptCompatApplyOn; injectJS($con2); $nscompat!=true ? 0 : $nsChk!=-1 ? 0 : $nsGlobalReady==true ? 0 : &Greasify_NoScriptCompatApplyOff; $sbgo = getpref(INT,$_Greasify_Custom.".statusbarmsg"); $z<1 ? $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_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{ index($activeURL, $mid1)!=-1 ? index($activeURL, $mid2)!=-1 ? $z = 1 : $z = $z; } Greasify_gEvalAllAlt_BeginEndStar{ $activeURLa = substr($activeURL,0,$mid1Length); $activeURLa==$mid1 ? index($activeURL, $mid2)!=-1 ? $z = 1 : $z = $z; } Greasify_gEvalAllAlt_BeginStarEnd{ $activeURLLength = $activeURLLength - $mid2Length:0; $activeURLb = substr($activeURL,$activeURLLength,$mid2Length):0; $activeURLb==$mid2 ? index($activeURL, $mid1)!=-1 ? $z = 1 : $z = $z; } Greasify_gEvalAllAlt_BeginEnd{ $activeURLa = substr($activeURL,0,$mid1Length):0; $activeURLLength = $activeURLLength - $mid2Length:0; $activeURLb = substr($activeURL,$activeURLLength,$mid2Length):0; $activeURLa==$mid1 ? $activeURLb==$mid2 ? $z = 1 : $z = $z; } 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; } 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 = '
Greasify<\/h1>\ v.".$getVer."<\/h3>
Scripts\ \;in\ \;Repository<\/h5>".$g_scripts."<\/code><\/pre>Greasify\ \;Homepage<\/a><\/tbody><\/table>close<\/a><\/div>'; var head = document.getElementsByTagName('head')[0]; var style = document.createElement('style'); style.type = 'text\/css'; style.innerHTML = '\#greasifydiv \{visibility\: hidden\; position\: absolute\;left\: 0px\;top\: 0px\;width\:100\%; height\:500\%\!important\; z-index\: 200\;} \#greasifydiv div \{width\: 90\%\;margin\: 100px auto\;background-color\:\#fff\; border\: 1px solid \#000\;padding\:15px\;z-index\:201\;\} \#greasifyTable \{padding\:3px\; border-collapse\:collapse\;border\: 1px solid \#000\;\} .g_cen \{text-align\:center\!important\; margin-left\:auto\!important\; margin-right\:auto \!important\; text-align\:center\!important\; font-family\:\\\'Lucida Grande\\\', \\\'Trebuchet MS\\\'\, Arial\, Helvetica\, sans-serif\!important\; \} h1 \{font-size\:1.3em\!important\;\} #scrpre \{padding\:5px\ 10px \!important\; overflow\:auto\!important\; border\:1px solid \#ccc\!important\; border-left\:3px solid \#ddd\!important\; border-right\:0\!important\; font-size\:1em\!important\; background\:\#eee\!important\; font-family\: \\\"Monaco\\\"\, \\\"Bitstream Vera Sans Mono\\\"\, \\\"Courier New\\\"\, serif\!important\; overflow\:scroll\!important\; \} body \{margin\: 0\!important\; padding\: 0\!important\; background\: \#fff\!important\; font-family\: Arial\, Helvetica\, sans-serif\!important\; width\:92\%\!important\; margin-left\:auto\!important\; margin-right\:auto \!important\; overflow\:auto\!important\; \}'; head.appendChild(style);var greasifydiv = document.getElementById('greasifydiv');greasifydiv.style.visibility = (greasifydiv.style.visibility == 'visible') ? 'hidden' : 'visible';var close = document.getElementById('greasifyClose');close.addEventListener('click',function(e) { var greasifydiv = document.getElementById('greasifydiv');greasifydiv.style.visibility = (greasifydiv.style.visibility == 'visible') ? 'hidden' : 'visible'; },false);"):0; $modalpref==true ? injectCSS("#greasifydiv {background: url('data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%002%00%00%002%01%03%00%00%00%24%F1%1A%F2%00%00%00%06PLTE%9D%BF%C4%FF%FF%FFo%99%7C%D4%00%00%00%02tRNS%FF%00%E5%B70J%00%00%00%01bKGD%01%FF%02-%DE%00%00%00%09pHYs%00%00%00H%00%00%00H%00F%C9k%3E%00%00%00yIDATx%01%05%C1%01%01%00%00%08%02%20%1C%D9I%07u%A2%13A%06%5C%0A6%03.%05%9B%01%97%82%CD%80K%C1f%C0%A5%603%E0R%B0%19p)%D8%0C%B8%14l%06%5C%0A6%03.%05%9B%01%97%82%CD%80K%C1f%C0%A5%603%E0R%B0%19p)%D8%0C%B8%14l%06%5C%0A6%03.%05%9B%01%97%82%CD%80K%C1f%C0%A5%603%E0R%B0%19p)%D8%0C%B8%14l%06%5C%0A%F6%01%90%ADD%F3%BDe%02%17%00%00%00%00IEND%AEB%60%82')!important; }"):0; $modalpref!=true ? 0 : $nsGlobalReady3=="noAccess" ? &Greasify_NoScriptCompatApplyOff:0; } Greasify_ScriptsActiveHelp{ $workpref = getpref(STRING,$_Greasify_Custom.".userscript".$un); $preflen = length($workpref); $nm = getpref(STRING,$_Greasify_Custom.".userscript".$un.".name"); $g_scripts = $g_scripts."\n".$un.". ".$nm."\t"."((".$workpref."))"; #length($workpref)<=0 ? $preflen = 0:$un = $un + 1; $preflen<=0 ? $preflen = 0:$un = $un + 1; $workpref = getpref(STRING,$_Greasify_Custom.".userscript".$un); $preflen = length($workpref); } Greasify_SetScripts{ &Greasify_SetScripts1; &Greasify_SetScripts2; } Greasify_SetScripts1{ $g_FOLDERPATH = getpref(STRING,$_Greasify_Custom.".directory"); $g_FOLDERPATH = $g_FOLDERPATH==""? (getfolder(UserMacroFolder))."\\greasify\\uscripts" : $g_FOLDERPATH; $foldlen = length($g_FOLDERPATH); $g_FILEPATH = promptforfile($g_FOLDERPATH,"User Script Files","*.user.js"); } Greasify_SetScripts2{ $filelen = length($g_FILEPATH); $un = 1; $workpref = getpref(STRING,$_Greasify_Custom.".userscript".$un); $preflen = length($workpref); while ($preflen >= 1) &Greasify_SetScriptsHelp; $foldlen = $filelen - $foldlen; $filelen = $filelen - $foldlen; $filelen = $filelen + 1; $g_FILEPATH = substr($g_FILEPATH, $filelen); length($g_FILEPATH)>1 ? $g_RESULT = confirm("Confirm addition of userscript ".$g_FILEPATH."?", $g_FILEPATH, YESNO, QUESTION):$g_RESULT = "NO"; $g_RESULT == "YES" ? &Greasify_SetScrCont:0; } Greasify_SetScrCont{ setpref(STRING,$_Greasify_Custom.".userscript".$un, $g_FILEPATH); setpref(INT,$_Greasify_Custom.".scripttotal", $un); $xmain = $un; &Greasify_ClearIncExcPrefsProc; statusbar("Done clearing include/exclude URL."); $xmain = $un; &Greasify_AddScriptPrefsGen; } Greasify_SetScriptsHelp{ $workpref = getpref(STRING,$_Greasify_Custom.".userscript".$un); $preflen = length($workpref); #index($g_FILEPATH,"\\".$workpref)!=-1 ? &Greasify_addScrAlert : 0; #alert($g_FILEPATH."\n\n".$workpref."\n\n\n","",INFO); $preflen<1 ? 0 : index($g_FILEPATH,$workpref)==-1 ? 0 : alert("This script appears to already be in the repository","Script Already In Repository?",INFO); length($workpref)<=0 ? $preflen = 0:$un = $un + 1; } Greasify_Toggle{ $dtest = ""; $dtest2 = ""; togglepref(BOOL,$_Greasify_Custom.".enablednew"); $dtest = getpref(BOOL, $_Greasify_Custom.".enablednew"); $dtest=="" ? $dtest = true : $dtest = $dtest; $dtest==true ? $dtest2 = "Greasify Enabled": $dtest2 = $dtest2; $dtest==false ? $dtest2 = "Greasify Disabled": $dtest2 = $dtest2; statusbar($dtest2); menuchecked=getpref(BOOL,$_Greasify_Custom.".enablednew"); } Greasify_SBToggle{ $g_VALUE = getpref(INT,$_Greasify_Custom.".statusbarmsg"); $g_VALUE==0 ? setpref(INT,$_Greasify_Custom.".statusbarmsg", 1):setpref(INT,$_Greasify_Custom.".statusbarmsg", 0); $g_VALUE==0 ? statusbar("Greasify Status-bar Notification Disabled"):statusbar("Greasify Status-bar Notification Enabled"); getpref(INT,$_Greasify_Custom.".statusbarmsg")!=1 ? setpref(BOOL,$_Greasify_Custom.".statbarnew",TRUE):setpref(BOOL,$_Greasify_Custom.".statbarnew",FALSE); menuchecked=getpref(BOOL,$_Greasify_Custom.".statbarnew"); } Greasify_ScriptsApplied{ $g_scriptsactive = getpref(STRING,$_Greasify_Custom.".scripts.active"); alert($g_scriptsactive,"Userscripts Applied to the Current Page",INFO); } Greasify_AddStyle{ $con2 = $con2."\n\n"."function GM_addStyle(css) {var head = document.getElementsByTagName('head')[0]; if (!head) { return; } var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style);}"."\n"; } Greasify_ApplyNow{ &Greasify_MainStart; } Greasify_ExportScriptList{ $un = 1; $count = getpref(INT,$_Greasify_Custom.".scripttotal"); $g_scripts = ""; $workpref = getpref(STRING,$_Greasify_Custom.".userscript1"); $preflen = length($workpref); while ($preflen != 0) &Greasify_ScriptsActiveHelp; $g_scripts = gsub("\n1.", "Greasify User Script List \n1. ", $g_scripts); setclipboard($g_scripts); } Greasify_ViewScript{ $scrnum = ""; $g_LOCALPATH = getpref(STRING,$_Greasify_Custom.".directory"); &Greasify_ScriptsActive; $scrnum = prompt("Enter script number to view:", "View Script - Selection", ""); $scrnum!="" ? &Greasify_ViewScript2:0; $scrnum!="" ? open($scrtoView):0; } Greasify_ViewScript2{ $scrtoView = getpref(STRING,$_Greasify_Custom.".userscript".$scrnum); $scrtoView = $g_LOCALPATH."\\".$scrtoView; $scrtoView = gsub("\\", "\/", $scrtoView); $scrtoView = "file\:\/\/\/".$scrtoView; } Greasify_VerifyScript{ $vchk = ""; $vchk = getpref(BOOL,$_Greasify_Custom.".copyclipboard"); $vchk==false ? setpref(BOOL,$_Greasify_Custom.".copyclipboard",TRUE) : setpref(BOOL,$_Greasify_Custom.".copyclipboard",FALSE); menuchecked=getpref(BOOL,$_Greasify_Custom.".copyclipboard"); } Greasify_NoScriptCompat{ togglepref(BOOL,$_Greasify_Custom.".nscompat"); menuchecked=getpref(BOOL,$_Greasify_Custom.".nscompat"); } Greasify_NoScriptCompatApplyOn{ setpref(STRING,"capability.policy.default.javascript.enabled","allAccess"); setpref(BOOL,"noscript.global","true"); } Greasify_NoScriptCompatApplyOff{ setpref(STRING,"capability.policy.default.javascript.enabled","noAccess"); setpref(BOOL,"noscript.global","false"); } Greasify_ClearIncExcPrefs{ $xmain = 1; $xtotal = getpref(INT,$_Greasify_Custom.".scripttotal"); $xname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain); $xnameLEN = length($xname); while ($xnameLEN != 0) &Greasify_ClearIncExcPrefsProc; statusbar("Done clearing include/exclude URLs."); } Greasify_ClearIncExcPrefsProc{ statusbar("Clearing URLs for userscript ".$xmain); $QQe = getpref(INT,$_Greasify_Custom.".userscript".$xmain.".exclude.total"); $rcnt = 1; while ($rcnt <= $QQe) &Greasify_ClearExcludes; setpref(INT,$_Greasify_Custom.".userscript".$xmain.".exclude.total",0); ###setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".exclude.string",""); $QQi = getpref(INT,$_Greasify_Custom.".userscript".$xmain.".include.total"); $rcnt = 1; $Rname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain.".include.".$rcnt); $RnameLEN = length($Rname); while ($RnameLEN > 0) &Greasify_ClearIncludes; setpref(INT,$_Greasify_Custom.".userscript".$xmain.".include.total",0); #setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".include.string",""); setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".name",""); $xmain = $xmain + 1; $xname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain); $xnameLEN = length($xname); } Greasify_ClearIncludes{ setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".include.".$rcnt,""); $rcnt = $rcnt + 1; $Rname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain.".include.".$rcnt); $RnameLEN = length($Rname); } Greasify_ClearExcludes{ setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".exclude.".$rcnt,""); $rcnt = $rcnt + 1; } Greasify_AddScriptPrefsGen{ $g_LOCALPATH = getpref(STRING,$_Greasify_Custom.".directory"); $g_scripts = ""; $excludeTotal = 0; $includeTotal = 0; &Greasify_GenIncExcProcessor; $xmain = $xmain - 1; $xname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain); #statusbar("Done processing include/exclude URLs for ".$xname."."); length($NS)==0? $NS = "" : 0; statusbar("Done processing include/exclude URLs for ".$xname." - ".$NS."."); } Greasify_GenerateAllInOne{ &Greasify_ClearIncExcPrefs; &Greasify_GenerateIncExcPrefs; } Greasify_GenerateIncExcPrefs{ $g_LOCALPATH = getpref(STRING,$_Greasify_Custom.".directory"); $g_scripts = ""; $excludeTotal = 0; $includeTotal = 0; $xtotal = getpref(INT,$_Greasify_Custom.".scripttotal"); $xmain = 1; $xname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain); $xnameLEN = length($xname); while ($xnameLEN != 0) &Greasify_GenIncExcProcessor; statusbar("Done processing include/exclude URLs."); } Greasify_GenIncExcProcessor{ statusbar("Processing URLs for userscript ".$xmain); &Greasify_ProcessHeader; $NS = gsub("\n","",$NS);$NS = gsub("\t","",$NS); $NS==""?0:&Greasify_NameGenHelp; $NS==""?setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".name","--unnamed--"):setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".name",$NS); $excIdx>0 ? &Greasify_ExcludeChk1:0; &Greasify_GHostChkSeven1; $excIdx>0 ? setpref(INT,$_Greasify_Custom.".userscript".$xmain.".exclude.total",$excludeTotal): 0; setpref(INT,$_Greasify_Custom.".userscript".$xmain.".include.total",$includeTotal); $Qq = 1; $excIdx>0 ? $ctest = "TRUE" : $ctest = "FALSE"; $ctest=="TRUE" ? &Greasify_GenExcludesK15 : $ctest = $ctest; $Qq = 1; $Qname = $includeURL1st; $QnameLEN = length($Qname); while ($QnameLEN > 0) &Greasify_GenIncludes; $xmain = $xmain + 1; $xname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain); $xnameLEN = length($xname); } Greasify_GenExcludes{ &Greasify_GExcludeAssist1; $excludeURL = gsub(" ", "", $excludeURL); setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".exclude.".$Qq,$excludeURL); $Qq = $Qq + 1; } Greasify_GenExcludesK15{ while ($Qq <= $excludeTotal) &Greasify_GenExcludes; $ctest = "FALSE"; } Greasify_GenIncludes{ &Greasify_GHostChkSevenAssist1; $QnameLEN = length($includeURL); $QnameLEN>=1 ? &Greasify_GenIncludesContinued:0; } Greasify_GenIncludesContinued{ #&Greasify_GHostChkSevenAssist1; $includeURL = gsub(" ", "", $includeURL); setpref(STRING,$_Greasify_Custom.".userscript".$xmain.".include.".$Qq,$includeURL); $Qq = $Qq + 1; #$QnameLEN = length($includeURL); } Greasify_NewInjectJS{ $P1 = $g_LOCALPATH."\\".$xname; $CONTENT = readfile( $P1 ); #$USHstart = index($CONTENT, "\/\/ ==UserScript=="); $USHend = index($CONTENT, "\/\/ ==\/UserScript=="); $con2IDX = $USHend + 19; $con2 = substr($CONTENT,$con2IDX); index($con2,"GM_addStyle(")>=1 ? &Greasify_AddStyle:0; &Greasify_InjectJS; } Greasify_NameGenHelp{ $cfs = substr($NS,0,1); while ($cfs == " ") &Greasify_NameGenHelpProc; } Greasify_NameGenHelpProc{ $NS = substr($NS,1); $cfs = substr($NS,0,1); } Greasify_ProcessHeader{ $xname = getpref(STRING,$_Greasify_Custom.".userscript".$xmain); $xnameLEN = length($xname); $P1 = $g_LOCALPATH."\\".$xname; $CONTENT = readfile( $P1 ); $USHstart = index($CONTENT, "\/\/ ==UserScript=="); $USHend = index($CONTENT, "\/\/ ==\/UserScript=="); $con2IDX = $USHend + 19; $activeURL = $URL; $USHend = $USHend - $USHstart; $USHeader = substr($CONTENT, $USHstart, $USHend); $strAidx = index($USHeader, "\/\/\ \@include"); $strA = substr($USHeader,$strAidx); $excIdx = index($USHeader, "\/\/\ \@exclude"); $excIdx>0 ? $excludeURLs = substr($USHeader,$excIdx):0; $excIdx>0 ? $excludeURLs = gsub("\n","",$excludeURLs):0; $excIdx>0 ? $excludeURLs = gsub("\t","",$excludeURLs):0; $NS = index($USHeader, "\/\/\ \@name"); $NS = substr($USHeader,$NS); $NS = substr($NS,10); $NSend = index($NS, "\/\/\ \@namespace"); $NS = substr($NS,0,$NSend); $z = 0; $includeURLs = $strA; $includeURLs = gsub("\n","",$includeURLs); $includeURLs = gsub("\t","",$includeURLs); } Greasify_GetVersion{ $getVer = getpref(STRING,$_Greasify_Custom.".version"); } Greasify_TempDisableScript{ &Greasify_ScriptsActive; $scrnum = prompt("Enter script number to disable:", "Select Script To Disable", ""); $scrnum!="" ? $scrtodis = getpref(STRING,$_Greasify_Custom.".userscript".$scrnum):$scrtodis = ""; $scrnum!="" ? $confdis = confirm("Disable ".$scrtodis."?", "Temporary Disable Script", YESNO, QUESTION):$confdis = "NO"; $confdis=="YES" ? setpref(INT,$_Greasify_Custom.".userscript".$scrnum.".include.total",0) : 0; $confdis=="YES" ? setpref(INT,$_Greasify_Custom.".userscript".$scrnum.".exclude.total",0) : 0; $disname = getpref(STRING,$_Greasify_Custom.".userscript".$scrnum.".name"); $confdis=="YES" ? setpref(STRING,$_Greasify_Custom.".userscript".$scrnum.".name","\<\!Script Disabled\!\>\ \(\(".$disname."\)\)") : 0; $dislist = getpref(STRING,$_Greasify_Custom.".scripts.disabled"); #$confdis=="YES" ? setpref(STRING,$_Greasify_Custom.".scripts.disabled",$dislist."|".$scrnum):0; delpref(STRING,$_Greasify_Custom.".scripts.disabled"); statusbar($scrtodis." disabled."); } Greasify_ReEnableScript{ &Greasify_ScriptsActive; $scrnum = prompt("Re-Enable Script?:", "Select Script To Enable", ""); $scrnum!="" ? $scrtoren = getpref(STRING,$_Greasify_Custom.".userscript".$scrnum):$scrtoren = ""; $scrnum!="" ? $confren = confirm("Re-Enable ".$scrtoren."?", "Re-Enable Disabled Script", YESNO, QUESTION):$confren = "NO"; $confren=="YES" ? &Greasify_ReEnableScriptHelper:0; statusbar($scrtoren." re-enabled."); } Greasify_ReEnableScriptHelper{ $xmain = $scrnum; &Greasify_AddScriptPrefsGen; } Greasify_UseModalPref{ #$answer = prompt("Re-Enable Script?:", "Select Script To Enable", ""); $answer = confirm("Use New Modal Dialog for Script Repository?", "Enable / Disable Modal Dialog", YESNO, QUESTION); $answer=="" ? 0 : $answer=="YES" ? setpref(BOOL,$_Greasify_Custom.".use_modal",true): setpref(BOOL,$_Greasify_Custom.".use_modal",false); menuchecked=getpref(BOOL,$_Greasify_Custom.".use_modal"); } Greasify_SetWGetDir{ $wdl = "NO"; $wgo = confirm("Do you have wget.exe?", "WGET.EXE required for userscripts.org integration", YESNO, QUESTION); $wgo=="NO" ? $wdl = confirm("Do you want to go to the download page for wget.exe?", "Go to WGET webpage to download?", YESNO, QUESTION) : 0; $wdl=="YES" ? &Greasify_WgetDownload:0; $wgo=="YES" ? $wgetPath = promptforfolder("Select Folder Containing wget.exe") : 0; $wgo!="YES" ? 0 : $wgetPath!="" ? setpref(STRING,$_Greasify_Custom.".wget_path", $wgetPath):0; } Greasify_WgetDownload{ $OpenURL="http://gnuwin32.sourceforge.net/packages/wget.htm"; &OpenURL_InNew; } Greasify_LoadScriptFromWebStart{ $ginst = "NO"; $ginst = confirm("Do you want to install this script?", "Greasify: Install Scrtipt?", YESNO, QUESTION); $ginst=="YES"?&Greasify_LoadScriptFromWeb:0; } Greasify_LoadScriptFromWeb{ $uscriptURL = $URL; $wgetPath = getpref(STRING,$_Greasify_Custom.".wget_path"); $wgetPath=="" ? &Greasify_SetWGetDir : 0; $g_LOCALPATH = getpref(STRING,$_Greasify_Custom.".directory"); $g_LOCALPATH = $g_LOCALPATH==""? (getfolder(UserMacroFolder))."\\greasify\\uscripts" : $g_LOCALPATH; #$wgetPath!="" ? alert($wgetPath."\\wget \"".$uscriptURL."\" -P \"".$g_LOCALPATH."\"","",INFO):0; $wgetPath!="" ? exec($wgetPath."\\wget \"".$uscriptURL."\" -P \"".$g_LOCALPATH."\""):0; $wgetPath!="" ? &Greasify_LoadScriptFromWebInstall : 0; } Greasify_LoadScriptFromWebInstall{ &Greasify_addDelay; #alert($wgetPath."\\wget \"".$uscriptURL."\" -P \"".$g_LOCALPATH."\"","",INFO); #exec($wgetPath."\\wget \"".$uscriptURL."\" -P \"".$g_LOCALPATH."\""); $g_FILEPATH = $g_LOCALPATH."\\".$scriptBase; $foldlen = length($g_LOCALPATH); &Greasify_SetScripts2; } Greasify_addDelay{ $g_delay = 1; while ($g_delay < 250) &Greasify_addDelay_Increment; } Greasify_addDelay_Increment{ $g_delay = $g_delay + 1; $g_delay = $g_delay - 1; $g_delay = $g_delay + 1; } Greasify_Help{ &Greasify_GetVersion; alert("Greasify K-Meleon Userscripts Macro\nversion ".$getVer."\n\n1. You must \'Set Userscripts Directory\' to where you have your UserScripts. \(i.e. the directory containuing the .user.js files.\) This can be any directory, for instance, create a \'gm\' subdirectory in your K-Meleon dir and copy your scripts there.\n\n2. You must \'Add User Script\(s\) To Repository\' via the GUI. The scripts contained in your \'gm\' directory will not be active until added into the repository with this step.\n\n3. You can check to see which ones are loaded by selecting \'Show Userscripts In Repository\'.\n\n4. \'Show Actively Applied Scripts To Page\' will verify which userscripts have been applied to the current page.\n\n5. \'NoScript Compatibility Mode\' \- allows the userscript to apply even to pages that are not on the NoScript whitelist (only enable if you are using NoScript\n\n6. \'Generate Includes and Excludes\' \- should be manually run when upgrading from versions below 0.7. This can also be used to re-generate the include/exclude URL prefs.\n\nCurrent limits\: 500 maximum scripts\, 16 maximum \@include URLs per script\, 8 maximum \@exclude URLs per script.\nControl\-Alt\-U is default keyboard shortcut to toggle Greasify on and off.\n","Greasify Help",INFO); } # ----- PRIVATE $_Greasify_Custom=$macroPrefBranch."greasify"; _Greasify_BuildMenu{ $_gmenu="&Greasify"; setmenu(PrivacySecurity,popup,$_gmenu); setmenu($_gmenu,macro,"&Toggle Greasify On/Off",Greasify_Toggle,0); #setmenu($_gmenu,separator,"Set Userscripts &Directory"); setmenu($_gmenu,macro,"Set Userscripts &Directory",Greasify_SetDir,1); setmenu($_gmenu,separator,"&Add User Script From Repository",2); setmenu($_gmenu,macro,"&Add User Script To Repository",Greasify_SetScripts,3); setmenu($_gmenu,macro,"&Remove Script From Repository",Greasify_DelScript,4); setmenu($_gmenu,separator,"&Show Userscripts In Repository",5); setmenu($_gmenu,macro,"&Show Userscripts In Repository",Greasify_ScriptsInRepository,6); #setmenu($_gmenu,macro,"&Show Userscripts In Repository",Greasify_ScriptsActive,6); setmenu($_gmenu,macro,"Show Actively A&pplied Scripts",Greasify_ScriptsApplied,7); #setmenu($_gmenu,separator,"Apply Greasify &Now"); setmenu($_gmenu,separator,"&Advanced",8); #setmenu($_gmenu,separator,"Help",10); setmenu($_gmenu,macro,"Help",Greasify_Help,10); setmenu($_gmenu,separator,"Apply Greasify &Now",11); setmenu($_gmenu,macro,"Apply Greasify &Now",Greasify_ApplyNow,12); &_Greasify_BuildMenuAdv; rebuildmenu($_gmenu); } _Greasify_BuildMenuAdv{ $_advmenu="&Advanced"; setmenu("&Greasify",popup,$_advmenu,9); setmenu($_advmenu,macro,"Toggle &NoScript Compatibility Mode",Greasify_NoScriptCompat); setmenu($_advmenu,macro,"Toggle Greasify &Statusbar Message",Greasify_SBToggle); setmenu($_advmenu,macro,"Copy &Applied Scripts To Clipboard",Greasify_VerifyScript); setmenu($_advmenu,macro,"Use Repository Modal?",Greasify_UseModalPref); setmenu($_advmenu,separator,"E&xport Script List to Clipboard"); setmenu($_advmenu,macro,"E&xport Script List to Clipboard",Greasify_ExportScriptList); setmenu($_advmenu,macro,"&View Script Source In Browser",Greasify_ViewScript); setmenu($_advmenu,separator,"&Disable A Script"); setmenu($_advmenu,macro,"&Disable A Script",Greasify_TempDisableScript); setmenu($_advmenu,macro,"Re-&Enable A Script",Greasify_ReEnableScript); setmenu($_advmenu,macro,"&Clear Includes and Excludes",Greasify_ClearIncExcPrefs); setmenu($_advmenu,macro,"&Generate Includes and Excludes",Greasify_GenerateAllInOne); #setmenu($_advmenu,macro,"Generate Includes and Excludes",Greasify_GenerateIncExcPrefs); #setmenu($_advmenu,macro,"Test something",Greasify_addDelay); rebuildmenu($_advmenu); #rebuildmenu($_gmenu); } _Greasify_SetAccels{ setaccel("CTRL ALT U","macros(Greasify_Toggle)"); } _Greasify_SetVersion{ setpref(STRING,$_Greasify_Custom.".version","0.7.9.2.20071129"); } _Greasify_OnLoad{ #getpref(INT,$_Greasify_Custom.".enabled")!=0 ? &Greasify_MainStart:0; ##getpref(BOOL,$_Greasify_Custom.".enablednew")!=false ? &Greasify_MainStart:0; getpref(BOOL,$_Greasify_Custom.".enablednew")!=false ? &Greasify_GoGrease:0; } $OnInit=$OnInit."_Greasify_SetAccels;_Greasify_BuildMenu;_Greasify_SetVersion;"; #$OnInit=$OnInit."_Greasify_SetAccels;_Greasify_BuildMenu;"; #$OnInit=$OnInit."_Greasify_BuildMenu;"; $OnLoad=$OnLoad."_Greasify_OnLoad;"; # ------------------------------------------------------------------------------------------------------------------ $macroModules=$macroModules."Greasify;";