Jump to content
Stilgar

FF.au3 (V0.6.0.1b-10)

Recommended Posts

Hello Stilgar,

As GerardJ asked before, do you have any plan on implementing the onchange of the javascript code ?

Because I need this implementation for a project and it's very difficult to use other solutions.

At the moment I use the _FFCmd() function to send the javascript code but it's not always possible.

I wait a reponse of you.

PS : sorry for my english, but i'm french and i'm not very good.

Share this post


Link to post
Share on other sites

@trinitrotoluen:

I add in one of the next versions the "OutputDebugString" via the Kernel32.lib.

Shows ths this error-picture the same problem like the others before with _FFSetPrefs?

@GerardJ / LionelG:

Yes I would implement onclick, onchange ... - events to the _FFForm* functions.

@Manadar:

Thank you!

The link to the english documentation is fixed now.

MozRepl-Installation:

The last script on this page:

http://autoit.de/index.php?page=Thread&threadID=3810

checks if MozRepl is installed and if not it installs it (optional).

Edited by Stilgar

Share this post


Link to post
Share on other sites

Excellent, thank you for this script.

Translated some comments and variable names to English:

;===============================================================================
#cs
    AutoIt Version: 3.2.12.1
    Author: Thunder-man (Frank Michalski)

    Script Function:  _MozRepl_Detect()
    Description:      Checks a Firefox profile for the MozRepl extension and installes it if not available.
    default:          $sProfile = "default"
    Return values:    True or False
    V 1.0 ==> 15.09.2007
    V 1.1 ==> 02.08.2008, updated by Stilgar (Thorsten Willert)
    changed the path-macro to @AppDataDir
    changed the ""-profil to "default"
    V1.2 ==> 03.03.2009, updated by Stilgar (Thorsten Willert)
    changed MozLab to MozRepl
    V2.0 ==> 17.03.2009, added intall-option for MozRepl by Stilgar (Thorsten Willert)

#ce
;===============================================================================

;  [Example]
;~ $Result = _MozRepl_Detect()
;~ MsgBox(64, "Result", $Result)

Func _MozRepl_Detect($sProfile = "default", $bInstall = True , $sXPI = "http://repo.hyperstruct.net/mozrepl/0.2/mozrepl.xpi")

    If $sProfile = "" Then $sProfile = "default"

    Local $sIni_Path = @AppDataDir & "\Mozilla\Firefox\"

    Local $var = IniReadSectionNames($sIni_Path & "\profiles.ini")
    If @error Then
        MsgBox(4096, "", "Error occurred, probably no Firefox INI file.")
    Else
        For $i = 1 To $var[0]
            Local $Ini_ = IniRead($sIni_Path & "\profiles.ini", $var[$i], "Name", "Error")
            If $Ini_ = $sProfile Then
                Local $sPath_folder = IniRead($sIni_Path & "\profiles.ini", $var[$i], "Path", "Eror") ;Profil Ordner
                ExitLoop
            EndIf
        Next
    EndIf

    If $bInstall Then
        Local $sHKLM = "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox"
        Local $sFFExe = RegRead($sHKLM & "\" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe")
        Local $sCommand = StringFormat('"%s" "%s"',$sFFExe, $sXPI)
    EndIf

    If StringLeft($sPath_folder, 8) = "Profiles" Then
        If FileExists($sIni_Path & $sPath_folder & "\extensions\mozrepl@hyperstruct.net") Then
            Return 1
        Else
            If $bInstall Then Return Run($sCommand)
            Return 0
        EndIf
    Else
        If FileExists($sPath_folder & "\extensions\mozrepl@hyperstruct.net") Then
            Return 1
        Else
            If $bInstall Then Return Run($sCommand)
            Return 0
        EndIf
    EndIf
EndFunc   ;==>_MozRepl_Detect

Share this post


Link to post
Share on other sites

Excellent, thank you for this script.

Translated some comments and variable names to English:

...

Thank you! I've uploaded it to the other examples on my homepage and added a link on the first post.

Share this post


Link to post
Share on other sites

@trinitrotoluen:

I add in one of the next versions the "OutputDebugString" via the Kernel32.lib.

Shows ths this error-picture the same problem like the others before with _FFSetPrefs?

Yes, and still appear in new version 0.5.3.6b-1 Edited by trinitrotoluen

Share this post


Link to post
Share on other sites

Yes, and still appear in new version 0.5.3.6b-1

I didn't changed anything in _FFPrefSet there, but you can use Debugview with this version now.

And I didn't use 10053 port

Like I said some posts before:

http://www.autoitscript.com/forum/index.php?showtopic=95595&view=findpost&p=704647

That's not the port number, that's the TCP-error number:

MSDN:

WSAECONNABORTED 10053

Software caused connection abort.

An established connection was aborted by the software in your host computer, possibly due to a data transmission time-out or protocol error.

Share this post


Link to post
Share on other sites

I didn't changed anything in _FFPrefSet there, but you can use Debugview with this version now.

Like I said some posts before:

http://www.autoitscript.com/forum/index.php?showtopic=95595&view=findpost&p=704647

That's not the port number, that's the TCP-error number:

MSDN:

Oh OK I forgot

Share this post


Link to post
Share on other sites

MozRepl doesn't seem to work with the new version of firefox (I have 3.5.1). I uninstalled it and then reinstalled it. Then I looked in the tools menu and there wasn't anything there. Is anyone else experiencing this too?


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

MozRepl doesn't seem to work with the new version of firefox (I have 3.5.1). I uninstalled it and then reinstalled it. Then I looked in the tools menu and there wasn't anything there. Is anyone else experiencing this too?

No, here it works with 3.5.1 (german version)

Which version of MozRepl do you have? 1.0 is the current.

Edited by Stilgar

Share this post


Link to post
Share on other sites

I download from http://repo.hyperstruct.net/mozrepl/1.0/mozrepl.xpi. Maybe it has something to do with my firefox. I changed a few things with firefox to make it run a bit faster (like activating pipelining and a few other things).


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

I download from http://repo.hyperstruct.net/mozrepl/1.0/mozrepl.xpi. Maybe it has something to do with my firefox. I changed a few things with firefox to make it run a bit faster (like activating pipelining and a few other things).

Have you tried to install MozRepl on an other FireFox-profile?

Share this post


Link to post
Share on other sites

@Valery:

Many thanks for this!

With your permission I'll put this on my homepage to the other translation(s).

Share this post


Link to post
Share on other sites

Ahh.

@Stilgar

This doc is now a part from Russian AutoIt3 help.

So links from subtopic "Related" have .htm file extensions.

But your help file extensions are always ".php".

This is reason of having i.e. on page

http://russian.documentation.ff-au3.thorsten-willert.de/ff_functions/_FFObjDelete.php

the following invalid links (in Related subtopic):

http://russian.documentation.ff-au3.thorsten-willert.de/ff_functions/_FFObjGet.htm

or

http://russian.documentation.ff-au3.thorsten-willert.de/ff_functions/_FFObjNew.htm

Share this post


Link to post
Share on other sites

Ahh.

@Stilgar

This doc is now a part from Russian AutoIt3 help.

So links from subtopic "Related" have .htm file extensions.

But your help file extensions are always ".php".

This is reason of having i.e. on page

http://russian.documentation.ff-au3.thorsten-willert.de/ff_functions/_FFObjDelete.php

the following invalid links (in Related subtopic):

http://russian.documentation.ff-au3.thorsten-willert.de/ff_functions/_FFObjGet.htm

or

http://russian.documentation.ff-au3.thorsten-willert.de/ff_functions/_FFObjNew.htm

Oh thanks. I forget to change this. They are fixed now.

They are php-files because they are only some templates using this informations:

http://www.thorsten-willert.de/Themen/FFau3/Dokumentation_-_German/FF.au3_info.txt

and this examples:

http://thorsten-willert.de/Themen/FFau3/Beispiele/files

Edited by Stilgar

Share this post


Link to post
Share on other sites

BTW. I've rewritten your example "Test of embedding FireFox".

; Best use with a new "clean" FF-profile only with MozRepl installed.
; Example: Embedding a FireFox inside an AutoIt GUI
;  Download and install MozRepl, only

#Region Includes
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <FF.au3>
#EndRegion Includes

$hGui = GUICreate ( "Embedded FireFox Test", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUI_Button_Back    = GuiCtrlCreateButton   ("Back",     10, 420, 100,  30)
$GUI_Button_Forward = GuiCtrlCreateButton   ("Forward", 120, 420, 100,  30)
$GUI_Button_Home    = GuiCtrlCreateButton   ("Home",    230, 420, 100,  30)
$GUI_Button_Stop    = GuiCtrlCreateButton   ("Stop",    330, 420, 100,  30)
$GUI_Button_Google  = GUICtrlCreateButton   ("Google",  430, 420, 100,  30)
$GUI_Button_Mozilla = GUICtrlCreateButton   ("Mozilla", 530, 420, 100,  30)

GUISetState()

_FF_CreateEmbedded($hGUI, 10, 40 , 600 , 360)
_FFOpenURL("Google.com")

While True
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            _FFQuit()
            Exit
        Case $msg = $GUI_Button_Google
            _FFOpenURL("Google.com")
        Case $msg = $GUI_Button_Mozilla
            _FFAction("About", "mozilla")
        Case $msg = $GUI_Button_Home
            _FFAction("Home", "")
        Case $msg = $GUI_Button_Back
            _FFAction("Back", "")
        Case $msg = $GUI_Button_Forward
            _FFAction("Forward", "")
        Case $msg = $GUI_Button_Stop
            _FFAction("Stop", "")
    EndSelect
WEnd

;===============================================================================

Func _FF_CreateEmbedded($hGUI,$x, $y, $width, $height, $iTimeOut = 10000)
    Local $sFuncName = "_FF_CreateEmbedded"
    Local $OK

    Local $sHKLM = "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox"
    Local $sFFExe = RegRead($sHKLM & "\" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe")

    WinSetOnTop($hGUI,"",1)

    Run($sFFExe & " about:blank", "", @SW_HIDE)
    Local $iTimeOutTimer = TimerInit()
    While 1
        Sleep(500)
        If ProcessExists($_FF_PROC_NAME) Then ExitLoop
        If (TimerDiff($iTimeOutTimer) > $iTimeOut) Then
            SetError(__FFError($sFuncName, $_FF_ERROR_Timeout, "Browser process not exists: " & $_FF_PROC_NAME))
            Return ""
        EndIf
    WEnd

    Do
        _FFConnect()
        $OK = @error
        If @error Then _FFDisConnect()
    Until Not $OK

    _FFWindowSelect()

    Local $hFF = _FFWindowGetHandle()
    WinMove($hFF, "", $x, $x, $width, $height)

    Do
        _FFAction("pm", True)
    Until Not @error

    WinMove($hFF, "", $x, $x, $width, $height)
    DllCall("user32.dll", "int", "SetParent", "hwnd", $hFF, "hwnd", $hGui)
    WinSetOnTop($hGUI,"",0)

    Return $hFF
EndFunc

It works fine under FireFox 3.5.1.

But after closing AutoIt shows some error. There are some unclosed connections, I think.

Now AutoIters have three nice embedded browser controls - IE, Mozilla and FireFox.

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

×
×
  • Create New...