Sign in to follow this  
Followers 0
Dethredic

Firefox Preference changer

14 posts in this topic

#1 ·  Posted (edited)

Hey,

After all my time here it is time for me to make my first script release

This script will change options found in the about:config menu. The values that i am changing can be changed to whatever suits your needs. (I hope there is nothing else like this out already)

I am not sure but there might be some errors if you don't own Firefox (didn't want to uninstall to test)

#include <GUIConstants.au3>
#include <File.au3>
#Include <Array.au3>
Global $prefs
 
$Form1 = GUICreate("Firefox Optimizer", 450, 195, 333, 258)
$FirefoxOptimizer = GUICtrlCreateTab(0, 0, 449, 193)
$TabSheet1 = GUICtrlCreateTabItem("Basic Optimization")
$Title = GUICtrlCreateLabel("Basic Optimization", 12, 36, 425, 17, $SS_CENTER)
$Lable1 = GUICtrlCreateLabel("This optimization works best if you have a broadband connection. It will decrease the time it takse to load pages.", 32, 56, 381, 33, $SS_CENTER)
$BasicOptimize = GUICtrlCreateButton("Optimize", 136, 128, 177, 25, 0)
$TabSheet2 = GUICtrlCreateTabItem("Custom Changes")
$Label2 = GUICtrlCreateLabel("Enter the name of the about:config setting you wish to change", 8, 32, 433, 17, $SS_CENTER)
$VlaueName = GUICtrlCreateInput("Value Name", 48, 56, 193, 21)
$Value = GUICtrlCreateInput("Value", 280, 56, 121, 21)
$Change = GUICtrlCreateButton("Change", 144, 112, 153, 25, 0)
$TabSheet3 = GUICtrlCreateTabItem("Advanced Optimization")
$Label3 = GUICtrlCreateLabel("Select the setting that is most revelent to your computer", 96, 40, 265, 17)
$Radio1 = GUICtrlCreateRadio("Fast Computer Fast Connection", 32, 72, 177, 17)
$Radio2 = GUICtrlCreateRadio("Fast Computer Slow Connection", 32, 104, 177, 17)
$Radio3 = GUICtrlCreateRadio("Slow Computer Fast Connection", 224, 72, 185, 17)
$Radio4 = GUICtrlCreateRadio("Slow Computer Slow Connection", 224, 104, 177, 17)
$Advanced = GUICtrlCreateButton("Optimize", 144, 144, 153, 25, 0)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)


While 1
    $msg = GuiGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
        Exit
    EndIf
    If $msg = $BasicOptimize Then
        Basic()
        If $msg  = $Advanced Then
            If GUICtrlRead($Radio1) = $GUI_CHECKED Then
                FastFast()
            ElseIf GUICtrlRead($Radio2) = $GUI_CHECKED Then
                FastSlow()
            ElseIf GUICtrlRead($Radio3) = $GUI_CHECKED Then
                SlowFast()
            ElseIf GUICtrlRead($Radio1) = $GUI_CHECKED Then
                SlowSlow()
            Else
                MsgBox(0, "Error", "Please select an option")
            EndIf
        EndIf
        If $msg = $Change Then
            Custom()
        EndIf
    EndIf
WEnd


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func Basic()
    $WebSite = "http://download.mozilla.org/?product=firefox-2.0.0.2&os=win&lang=en-US"

;Check if Firefox is Installed
$FF_version = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MOZILLA\MOZILLA FIREFOX\", "Currentversion")
;If not installed
If @error Then
    $Return = MsgBox(4, "Firefox Not Installed", "Firefox does not appeared to be installed on this machine. Would you like to download Firefox now?")
    If $Return = 6 Then
        Run(@ComSpec & " /c start " & $WebSite)
        MsgBox(0, "Re-Run", "Once Firefox is installed, please re run this script to optimize it.")
    Else
        MsgBox(0, "Error", "This program cannot optimize Firefox unless it is installed")
        Exit
    EndIf
EndIf

;Basic Optimization

;Gay Folder
$FileList =_FileListToArray(@AppDataDir & "\Mozilla\Firefox\Profiles\")
If @Error=1 Then
    MsgBox (0,"","Firefox can not be optimized due to a bad location of files")
    Exit
EndIf

$prefs = @AppDataDir & "\Mozilla\Firefox\Profiles\" & $filelist[1] & "\prefs.js"

;Check If Firefox is Running
MsgBox(4096, "Basic Optimization", "Firefox will now be optimized. Please close all instances of firefox including the download manager.")
If ProcessExists("Firefox.exe") Then
    $Return = MsgBox(4, "Firefox Still Open", "Firefox still aprears to be running. Do you want to terminate Firefox now?")
        If $Return = 6 Then
            ProcessClose("Firefox.exe")
            If FileExists($prefs) Then
                Basic_optimize()
            Else
                _FileCreate($prefs)
                Basic_optimize()
            EndIf
        Else
            MsgBox(0, "Optimization Terminated", "Firefox could not be optimized because it is still running.")
            Exit
        EndIf
    EndIf   
    
;Optimizing


If FileExists($prefs) Then
    Basic_optimize()
Else
    _FileCreate($prefs)
    Basic_optimize()
EndIf
EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func Basic_optimize()
    FileWrite($prefs, @CRLF)
;Search for network.http.pipelining
Dim $search = $prefs
Dim $find = "network.http.pipelining"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("network.http.pipelining", True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.pipelining", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.proxy.pipelining
Dim $find = "network.http.proxy.pipelining"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("network.http.proxy.pipelining", True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.proxy.pipelining", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.pipelining.maxrequests
Dim $find = "network.http.proxy.pipelining"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("network.http.pipelining.maxrequests", 30);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.pipelining.maxrequests", 30);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;nglayout.initialpaint.delay
Dim $find = "nglayout.initialpaint.delay"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("nglayout.initialpaint.delay", 0);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("nglayout.initialpaint.delay", 0);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

MsgBox(0, "Success", "Firefox was optimized successfully")
;;;;End Func Basic Optimize
EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func FastFast()
    FileWrite($prefs, @CRLF)
;Search for content.interrupt.parsing
Dim $search = $prefs
Dim $find = "content.interrupt.parsing"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.interrupt.parsing", True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.interrupt.parsing", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.max.tokenizing.time
Dim $find = "content.max.tokenizing.time"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.max.tokenizing.time", 2250000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.max.tokenizing.time", 2250000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.interval
Dim $find = "content.notify.interval"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.interval", 750000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.interval", 750000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.ontimer
Dim $find = "content.notify.ontimer"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.ontimer", True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.ontimer", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.switch.threshold
Dim $find = "content.switch.threshold"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'content.switch.threshold", True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.switch.threshold", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-connections-per-server
Dim $find = "network.http.max-connections-per-server"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-connections-per-server", 16);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-connections-per-server", 16);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-persistent-connections-per-proxy
Dim $find = "network.http.max-persistent-connections-per-proxy"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-persistent-connections-per-proxy", 16);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-persistent-connections-per-proxy", 16);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-persistent-connections-per-server
Dim $find = "network.http.max-persistent-connections-per-server"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-persistent-connections-per-server", 8);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-persistent-connections-per-server", 8);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for browser.cache.memory.capacity
Dim $find = "browser.cache.memory.capacity"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'browser.cache.memory.capacity", 65536);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("browser.cache.memory.capacity", 65536);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next
MsgBox(0, "Success", "Firefox was optimized successfully")
EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func FastSlow()
    FileWrite($prefs, @CRLF)
;Search for content.max.tokenizing.time
Dim $search = $prefs
Dim $find = "content.max.tokenizing.time"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.max.tokenizing.time", 2250000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.max.tokenizing.time", 2250000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.interval
Dim $search = $prefs
Dim $find = "content.notify.interval"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.interval", 750000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.interval", 750000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.ontimer
Dim $search = $prefs
Dim $find = "content.notify.ontimer"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.ontimer", True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.ontimer", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.switch.threshold
Dim $search = $prefs
Dim $find = "content.switch.threshold"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.switch.threshold", 750000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.switch.threshold", 750000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-connections-per-server
Dim $find = "network.http.max-connections-per-server"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-connections-per-server", 16);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-connections-per-server", 16);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-persistent-connections-per-proxy
Dim $find = "network.http.max-persistent-connections-per-proxy"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-persistent-connections-per-proxy", 16);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-persistent-connections-per-proxy", 16);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-persistent-connections-per-server
Dim $find = "network.http.max-persistent-connections-per-server"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-persistent-connections-per-server", 8);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-persistent-connections-per-server", 8);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for browser.cache.memory.capacity
Dim $find = "browser.cache.memory.capacity"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'browser.cache.memory.capacity", 65536);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("browser.cache.memory.capacity", 65536);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next
MsgBox(0, "Success", "Firefox was optimized successfully")
EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func SlowFast()
    FileWrite($prefs, @CRLF)
;Search for content.max.tokenizing.time
Dim $search = $prefs
Dim $find = "content.max.tokenizing.time"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.max.tokenizing.time", 3000000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.max.tokenizing.time", 3000000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.backoffcount
Dim $search = $prefs
Dim $find = "content.notify.backoffcount"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.backoffcount", 5);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.backoffcount", 5);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.interval
Dim $search = $prefs
Dim $find = "content.notify.interval"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.interval", 1000000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.interval", 1000000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.ontimer
Dim $search = $prefs
Dim $find = "content.notify.ontimer"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.ontimer", True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.ontimer", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.maxtextrun
Dim $search = $prefs
Dim $find = "content.switch.threshold"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.switch.threshold", 1000000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.switch.threshold", 1000000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.maxtextrun
Dim $search = $prefs
Dim $find = "content.maxtextrun"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.maxtextrun", 4095);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.maxtextrun", 4095);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for nglayout.initialpaint.delay
Dim $search = $prefs
Dim $find = "nglayout.initialpaint.delay"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("nglayout.initialpaint.delay", 1000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("nglayout.initialpaint.delay", 1000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for nglayout.initialpaint.delay
Dim $search = $prefs
Dim $find = "nglayout.initialpaint.delay"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("nglayout.initialpaint.delay", 1000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("nglayout.initialpaint.delay", 1000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-connections-per-server
Dim $find = "network.http.max-connections-per-server"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-connections-per-server", 16);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-connections-per-server", 16);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-persistent-connections-per-proxy
Dim $find = "network.http.max-persistent-connections-per-proxy"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-persistent-connections-per-proxy", 16);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-persistent-connections-per-proxy", 16);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-persistent-connections-per-server
Dim $find = "network.http.max-persistent-connections-per-server"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-persistent-connections-per-server", 8);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-persistent-connections-per-server", 8);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for dom.disable_window_status_change
Dim $find = "dom.disable_window_status_change"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'dom.disable_window_status_change", 8);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("dom.disable_window_status_change", 8);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next
MsgBox(0, "Success", "Firefox was optimized successfully")
EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func SlowSlow()
        FileWrite($prefs, @CRLF)
;Search for content.max.tokenizing.time
Dim $search = $prefs
Dim $find = "content.max.tokenizing.time"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.max.tokenizing.time", 2250000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.max.tokenizing.time", 2250000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.interval
Dim $search = $prefs
Dim $find = "content.notify.interval"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.interval", 750000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.interval", 750000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.notify.ontimer
Dim $search = $prefs
Dim $find = "content.notify.ontimer"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.notify.ontimer", True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.notify.ontimer", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for content.switch.threshold
Dim $search = $prefs
Dim $find = "content.switch.threshold"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("content.switch.threshold", 750000);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("content.switch.threshold", 750000);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for nglayout.initialpaint.delay
Dim $search = $prefs
Dim $find = "nglayout.initialpaint.delay"

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("nglayout.initialpaint.delay", 750);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("nglayout.initialpaint.delay", 750);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-connections-per-server
Dim $find = "network.http.max-connections-per-server"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-connections-per-server", 16);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-connections-per-server", 16);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-persistent-connections-per-proxy
Dim $find = "network.http.max-persistent-connections-per-proxy"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-persistent-connections-per-proxy", 16);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-persistent-connections-per-proxy", 16);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for network.http.max-persistent-connections-per-server
Dim $find = "network.http.max-persistent-connections-per-server"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'network.http.max-persistent-connections-per-server", 8);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("network.http.max-persistent-connections-per-server", 8);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next

;Search for dom.disable_window_status_change
Dim $find = "dom.disable_window_status_change"
Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'dom.disable_window_status_change",True);', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("dom.disable_window_status_change", True);') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next
MsgBox(0, "Success", "Firefox was optimized successfully")
EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func Custom()
    FileWrite($prefs, @CRLF)

Dim $search = $prefs
Dim $find = $Value

Dim $aRecords
If Not _FileReadToArray($search,$aRecords) Then
   MsgBox(4096,"Error", "Error")
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringInStr($aRecords[$x], $find) Then _FileWriteToLine($prefs, $x, 'user_pref("' & $VlaueName &'", ' & $Value & ');', 1)
    If @error = 0 Then FileWrite($prefs, 'user_pref("' & $VlaueName &'", ' & $Value & ');') 
    FileWrite($prefs, @CRLF)
    ExitLoop
Next
MsgBox(0, "Success", "Setting changed successfully")
EndFunc

March 13

Added Basic GUI

More Optimization Options

Still to do

Better Custom changes - may be loadable presets

Better GUI

Edited by Dethredic

"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites



just a suggestions..

1. you could use an inifile for firefox location and profile, instead of hardcoding the locations, where the "gay folder" is. :whistle:

2. Run(@ComSpec & " /c start " & $WebSite), could be changed to shellexecute(), (im not 100% it run will launch the default browser or internet explorer.)


Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()

Share this post


Link to post
Share on other sites

2. Run(@ComSpec & " /c start " & $WebSite), could be changed to shellexecute(), (im not 100% it run will launch the default browser or internet explorer.)

well at first i was just using _IE create, but Manadar told me that would open it in a new window

"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

100 views and 1 comment?


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

Works like a charm. Good first release! cheer.gif

Thanks


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@dethredic

your script seems kinda nice. but it won´t work with my profile folder because i moved it to non-standard directories. so your script won´t find them anyway.

next thing is that i would suggest to insert this:

$FileList =_FileListToArray(@AppDataDir & "\Mozilla\Firefox\Profiles\")oÝ÷ Ù©Ýjëh×6$prefs = @AppDataDir & "\Mozilla\Firefox\Profiles\" & $filelist[1] & "\prefs.js")

This way the application data folder will be found in non-english windows-versions as well.

Today I thought if it´s possible to write a script that changes prefs.js. Now I know that it is. So maybe something like this would do great in a gui?

Anyways, your script is great. Good job!

Edited by unearth

Share this post


Link to post
Share on other sites

Thanks, never thought about different languages.

I think a GUI is a good idea, ill start over march break


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I think a GUI is a good idea, ill start over march break

Well, I can´t wait to see, what it´s going to be like.

I thought about the first part of your script. And I had an idea to ask the user to input the Fx folder and store the folder information. It´s a different approach to what your script is doing, but maybe there´s a way to combine them. So here´s the snippet:

$firefoxfolder = IniRead(@ScriptDir & "\data.ini", "FirefoxFolder", "Folder", "")
If $firefoxfolder = "Default" Then
    $var = FileSelectFolder("Please insert folder that contains "firefox.exe:", "", 4, @ProgramFilesDir & "\Mozilla Firefox")
    If @error <> 1 Then 
        IniWrite("data.ini", "FirefoxFolder", "Folder", $var)
    Else
        MsgBox(0, "Invalid Input", "The application will be closed.")
        Exit
    EndIf
Else
EndIf

You would also need a "data.ini" to do so. But it´s just a rough sketch and the english may sound a bit quirky, but you´ll get the idea, I hope.

So, keep up the good work.

Edited by unearth

Share this post


Link to post
Share on other sites

what makes you think the home drive has to be C? I would change everywhere in your script that uses "C:" to @HomeDrive

other than that, awsome!


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

UPDATED See Original post


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

UPDATED See Original post

great. I´m pretty swamped right now so I could only have brief look. but I will check it out as soon as possible.

as far as i can tell it´s working fine on my os now.

kudos

Share this post


Link to post
Share on other sites

what makes you think the home drive has to be C? I would change everywhere in your script that uses "C:" to @HomeDrive

other than that, awsome!

I think they should just make a new macro: @FirefoxDir :whistle:

Good job

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Updated Changed some spelling mistakes

Edited by Dethredic

"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0