Jump to content
Sign in to follow this  
Bert

Automate firefox

Recommended Posts

Thank You, awesome job. Me was waiting for firefox udf for ages now :)

Sadly, I can't get it to work. Tried running some examples from documentation page:

Example 1 (firefox closed):

#Include <FF.au3>
_FFStart()
If _FFIsConnected() Then
; add a new tab with an URL
    _FFTabAdd("http://ff-au3-example.thorsten-willert.de/")
    sleep(3000)
; closes FireFox
    _FFQuit()
EndIf

Firefox launches with previous sessions tabs + one new blank tab. Then adds new blank tab, but without close button! (imho, relevant addons- TabMixPlus and TreeStyleTab) and doesn't navigate to provided url. Finally it doesn't close. Script exit.

Console output:

__FFStartProcess: ""C:\Program Files\Mozilla Firefox\firefox.exe" -new-window "about:blank"  -repl 4242 
_FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3
_FFConnect: AutoIt: 3.3.0.0
_FFConnect: FF.au3: 0.5.3.5b-0
_FFConnect: IP: 127.0.0.1
_FFConnect: Port:   4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:     1516
__FFSend: try{window.content.frames["top"].document.browserDOMWindow}catch(e){'_FFCmd_Err';};
__FFRecv: 
__FFSend: try{navigator.userAgent}catch(e){'_FFCmd_Err';};
__FFRecv: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10
_FFConnect: Browser:    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10
_FFSendJavascripts: Sending functions to FireFox ........... done
_FFLoadWait: . loaded in 22ms
__FFSend: try{FFau3 != null?1:0}catch(e){'_FFCmd_Err';};
__FFRecv: 1
__FFSend: try{gBrowser.selectedTab = gBrowser.addTab('http://ff-au3-example.thorsten-willert.de/')}catch(e){'_FFCmd_Err';};
__FFRecv: _FFCmd_Err
_FFCmd ==> Error return value: _FFCmd_Err
__FFQuit: Closing FireFox ...

Example 2 (firefox already open):

#Include <FF.au3>
; add a new tab with an URL
_FFTabAdd("http://ff-au3-example.thorsten-willert.de/")
Sleep(10000)
; closes FireFox
_FFQuit()

Nothing happens at all.

Console output:

__FFSend ==> Socket Error
_FFCmd ==> Error return value

FF version: 3.0.10 - maybe thats the problem?

Please help, as I'm really looking forward to remaking a bunch of my scripts and switching from IE udf :party:

Share this post


Link to post
Share on other sites

@shEiD:

Hello,

thank you!

Example 1:

It could be a problem with your tab-AddOns, because of this error:

try{gBrowser.selectedTab = gBrowser.addTab('http://ff-au3-example.thorsten-willert.de/')}catch(e){'_FFCmd_Err';};
__FFRecv: _FFCmd_Err
_FFCmd ==> Error return value: _FFCmd_Err

have you tried without this AddOns, too?

Example 2:

At first you must made a connection to FF/MozRepl.

You can see this at this at this error:

__FFSend ==> Socket Error
_FFCmd ==> Error return value

You can check this if you using the function _FFIsConnected() e.g.

#Include <FF.au3>
_FFConnect() ; or _FFStart(Default, Default, 0) - connects to an open FF

If _FFIsConnected() Then
 ; add a new tab with an URL
 _FFTabAdd("http://ff-au3-example.thorsten-willert.de/")
 Sleep(10000)
 ; closes FireFox
 _FFQuit()
EndIf

Share this post


Link to post
Share on other sites

Thanks for such a fast answer. You were right - TabMixPlus was the trouble. It seems everything works, after disabling it.

Sadly, tab mix plus is one of the more usefull addons :/ Any idea what could be the problem between these two? Hopefully someone will figure it out. Maybe it could be used with some options disabled/unset.

Anyway, thanks again, Stilgar.

/me is off to play with FF.au3 :)

Edited by shEiD

Share this post


Link to post
Share on other sites

how to replace background color on youtube?

this code does not work and make mozRepl return some error

$socket = _FFConnect()
$sHTML = _FFReadHTML()
$sHTML = StringReplace($sHTML, 'id="BaseDiv"', 'bgcolor="#000000" id="BaseDiv"')
If Not @error Then _FFWriteHTML($sHTML)

__FFSend: try{content.document.body.innerHTML='





<div bgcolor="#000000" id="BaseDiv" class="date-20090519 video-info">
    

    
    <div id="masthead">
        <div id="masthead-inner">
                <a href="/" onmousedown="urchinTracker('/Events/Header_3/YouTubeLogo');" id="logo"><button onclick="window.location.href='/'; return false;" class="master-sprite" title=""></button></a>
            <div id="region-and-language-picker-links-wrapper">
                <button id="slogan" class="master-sprite" title=""></button>
                        <span class="util-item first with-flag"><a href="#" class="region-picker-link hLink" onclick="loadFlagImgs('region-picker-box'); return false;" onmousedown="urchinTracker('/Events/Header/UtilLinks/I18n/text');">Poland</a></span>
    <span class="util-item"><a href="#" class="language-picker-link hLink" onclick="loadFlagImgs('language-picker-box'); return false;" onmousedown="urchinTracker('/Events/Header/UtilLinks/I18n/text');">English</a></span>

            </div>
            <div class="user-info">
                    


    <div id="util-links" class="normal-utility-links">

        <span class="util-item first"><b><a class="hLink" href="/signup?next=/watch}catch(e){'_FFCmd_Err';};
__FFSend:;
__FFRecv:

line with the code where an error occurs should go like this

<span class="util-item first"><b><a class="hLink" href="/signup?next=/watch%3Fv%3DRyVcic7cZgA%26feature%3DPlayList%26p%3D120F15989C14A1B7%26index%3D4%26playnext%3D5%26playnext_from%3DPL" onmousedown="urchinTracker('/Events/Header/UtilLinks/SignUp');">

regards

Share this post


Link to post
Share on other sites

Thanks for such a fast answer. You were right - TabMixPlus was the trouble. It seems everything works, after disabling it.

Sadly, tab mix plus is one of the more usefull addons :/ Any idea what could be the problem between these two? Hopefully someone will figure it out. Maybe it could be used with some options disabled/unset.

Anyway, thanks again, Stilgar.

/me is off to play with FF.au3 :)

It could be that TabMixPlus override the standard tab-functions. I'll check this.

----------------------------

how to replace background color on youtube?

this code does not work and make mozRepl return some error

$socket = _FFConnect()
$sHTML = _FFReadHTML()
$sHTML = StringReplace($sHTML, 'id="BaseDiv"', 'bgcolor="#000000" id="BaseDiv"')
If Not @error Then _FFWriteHTML($sHTML)oÝ÷ ÙÊxQRzwyòÚòríz{]¡Ë¦z{[¡Ü¢w«3oÝ÷ ÚÜ©ày«­¢+Ù}
µ ÅÕ½Ðì¹Ñ±µ¹Ñ   å% Ìäí  Í¥ØÌä줹ÍÑÑÑÉ¥ÕÑ Ìäí½±½ÈÌäì°ÌäìÌäì¤ÅÕ½Ðì¤

Regards

Stilgar

Share this post


Link to post
Share on other sites

@shEiD:

I've tried now different AddOns which "manipulates" the tabs.

And the only which not work is TabMixPlus, because it seems to override something in the browser-functions. So if I wouldn't made the FF.au3 TabMixPlus compatible, only if this AddOn made some buggy hacks in the browser.

AddOns like "Tab Kit" do they same without compatibily problems.

Share this post


Link to post
Share on other sites

@shEiD:

I've tried now different AddOns which "manipulates" the tabs.

And the only which not work is TabMixPlus, because it seems to override something in the browser-functions. So if I wouldn't made the FF.au3 TabMixPlus compatible, only if this AddOn made some buggy hacks in the browser.

AddOns like "Tab Kit" do they same without compatibily problems.

Has someone finding a method to bypass the problem of INPUT TYPE=FILE which doesn't allow automation ?

Share this post


Link to post
Share on other sites

@shEiD:

I've tried now different AddOns which "manipulates" the tabs.

And the only which not work is TabMixPlus, because it seems to override something in the browser-functions. So if I wouldn't made the FF.au3 TabMixPlus compatible, only if this AddOn made some buggy hacks in the browser.

AddOns like "Tab Kit" do they same without compatibily problems.

Has someone finding a method to bypass the problem of INPUT TYPE=FILE which doesn't allow automation ?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...