Jump to content

# Firefox configuration

## Recommended Posts

• 8 months later...

hi

very good sample but add sample proxy list change.

##### Share on other sites

Thanks.
What do you mean by "proxy list" ?

Edited by jguinch

##### Share on other sites

@jguinch

Thanks,

Look here:

https://java.com/en/download/help/firefox_java.xml

_FF_Config('dom.ipc.plugins.java.enabled',False)

mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * *
ADO.au3 UDF * * * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt *

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

## 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
• ### Recently Browsing   0 members

No registered users viewing this page.

• ### Similar Content

• By mLipok
wd_capabilities.au3 UDF was changed/modified/refactored .... and commited/merged (02-12-2021) to https://github.com/Danp2/WebDriver

WARNING: Before you start using this UDF be sure you download the recent version from: https://github.com/Danp2/WebDriver

==================================================================================================

Recently I start wd_capabilities.au3 project on my side.
I think this is time to share to AutoIt community.
Check attached UDF: wd_capabilities.au3

Here is a scratch example showing how to use them:
#include "wd_helper.au3" #include "wd_capabilities.au3" _Example() Func _Example() ........ ........ ........ _WD_Capabilities_Build_Arguments(Null) ; CLEANUP ARGS _WD_Capabilities_Build_Arguments('--headless') _WD_Capabilities_Build_Arguments('start-maximized') _WD_Capabilities_Build_Arguments('disable-infobars') _WD_Capabilities_Build_Arguments('user-data-dir', 'C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data\Default') Local $s_WD_Capabilities_Arguments = _WD_Capabilities_Build_Arguments(Default) ; GET ARGS _WD_Capabilities_Build_Preferences(Null) ; CLEANUP PREFS If$s_Download_dir Then _WD_Capabilities_Build_Preferences('download.default_directory', $s_Download_dir) Local$s_WD_Capabilities_Preferences = _WD_Capabilities_Build_Preferences(Default) ; GET PREFS Local $s_Desired_Capabilities = _WD_Capabilities_Build_JSON('chrome',$s_WD_Capabilities_Arguments, $s_WD_Capabilities_Preferences) Local$WD_SESSION = _WD_CreateSession($s_Desired_Capabilities) ........ ........ ........ EndFunc I plan to publish the code on GitHub. In the indefinite future, when the project becomes more functional, if @Danp2 accepts it, I hope it may be included in the main WebDriver UDF. I am waiting for yours feedback and help in the further development of this project. REMARK 1: As so far this UDF only supports GoogleChrome. Adding support for other browsers shouldn't be difficult, I just didn't need to. REMARK 2: For now, this project is working but still as a early BETA, so please do not discuss, ask questions, or post examples or snippets of code that pertain to any function of this UDF in other part of this forum, until it is found acceptable. Simply: discusion and tests only here in this topic. Regards, @mLipok • This is for those pages that seem to load when you use _FFOpenURL(), but they have a text saying "please wait while we load your page..." but according to _FFOpenURL() the page has loaded. An example seen in popular sites is the Cloudflare page saying "Checking your browser before...". It's the opposite of pausing a script until an element is visible on a page. It takes Elements in the form of id, xpath or text search. Global$BrowserPort = 4242 Global $TimeOut = 60000 Global$LocalHost = "127.0.0.1" Func _FFWaitWhileElement($thiselement,$elementtype = "xpath", $timeoutms = 60000) _FFConnect($LocalHost, $BrowserPort,$TimeOut) Local $Element Local$ElementFound = 1 Local $TimeoutCountdown = 0 While$ElementFound <> 0 And $TimeoutCountdown <$timeoutms If $elementtype = "xpath" Then$Element = _FFXPath($thiselement) EndIf If$elementtype = "id" Then Local $ConstructXPath = ".//*[@id='" &$thiselement & "']" $Element = _FFXPath($ConstructXPath) EndIf ; MsgBox(0, "", $Element) Local$ElementXPathTextContent = _FFCmd("FFau3.xpath.textContent") ; MsgBox(0, "", $ElementXPathTextContent) Local$ElementXPathInnerHTML = _FFCmd("FFau3.xpath.innerHTML") ; MsgBox(0, "", $ElementXPathInnerHTML) If$ElementXPathTextContent = "_FFCmd_Err" Or $ElementXPathInnerHTML = "_FFCmd_Err" Then$ElementFound = 0 Else $ElementFound = 1 EndIf If$elementtype = "text" Then $ElementFound = _FFSearch($thiselement) ; MsgBox(0, "", $ElementFound) EndIf$TimeoutCountdown += 1000 _FFDisConnect() _FFConnect($LocalHost,$BrowserPort, $TimeOut) WEnd Return$ElementFound EndFunc _FFConnect($LocalHost,$BrowserPort, $TimeOut) _FFOpenURL("https://www.site.com/page", True) _FFWaitForElement("Please Wait...","text", 60000) MsgBox(0,"","Page finished loading") It's pretty simple, hope it helps some of you who are working with FF.au3 :) • So I was trying to write a function that can find a button (or any other XPath Element) and scroll the page + move the mouse to the location of the button. My logic for this was: 1. get position of button using _FFGetPosition 2. get inner dimensions of browser window and total dimensions of page 3. divide total dimensions by inner dimensions to get number of page down operations 4. use Mod() to get remaining pixels offset 5. MouseMove() and add requisite offsets for Titlebar etc (what the +5 and +54 is for in the last line) Example Code: _FFConnect($LocalHost, $BrowserPort,$TimeOut) Local $Button = _FFXPath(".//*[@id='thisbutton']") Local$ButtonPosition = _FFGetPosition($Button) Local$ElementWidth = $ButtonPosition[0] Local$ElementHeight = $ButtonPosition[1] Local$InnerWidth = _FFCmd("window.content.innerWidth") Local $InnerHeight = _FFCmd("window.content.innerHeight") Local$PageWidth = _FFCmd(".body.offsetWidth") Local $PageHeight = _FFCmd(".body.offsetHeight") Local$PGDNNo = Int($ElementHeight/$InnerHeight) Local $PGDNMod = Mod($ElementHeight, $InnerHeight) ; MsgBox(0,"","$ElementX: " & $ElementWidth & @CRLF & "$ElementY: " & $ElementHeight) ; MsgBox(0,"","$InnerWidth: " & $InnerWidth & @CRLF & "$InnerHeight: " & $InnerHeight) ; MsgBox(0,"","$PageWidth: " & $PageWidth & @CRLF & "$PageHeight: " & $PageHeight) ; MsgBox(0,"",$PGDNNo) ; MsgBox(0,"",$PGDNMod) Local$iter = 1 While $iter <=$PGDNNo WinActivate($BrowserWindowClass,"") _FFCmd("window.content.scrollByPages(1)")$iter += 1 WEnd MouseMove($ElementWidth + 5,$PGDNMod + 54) This isn't working. In some cases, it's not doing the page down operation the number of times needed, or not accurately pinpointing the location. I think there may be something wrong with the logic I'm using. What am I doing wrong?
Thanks.

• By Sanja
Hello forum,
I have the problem that I can not use Firefox in combination with WebDriver when using AutoIt on some websites. Of course it does not work with the very website I need it to work with.
As soon as I want to open the desired website, I get the little robot icon which tells me that the "browser is under remote control" and the website stays blank.
I CAN open the website (www.ebay-kleinanzeigen.de) but I get blocked when I want to go to my account, to be precise.

I am using AutoIt 3.3.14.5 I have checked my FireFox version. It is up to date. Also the special browser drivers like gecko etrc. are up to date too and everything works fine with the WebDriver demo.
It seems that another user also had the same problem, but the thread has already been closed and the users solution (setting security lower did not work for me).
I mean I can only choose between "standard", "strict" and "customized". On "customized I unchecked everything but it still would not change anything.
I also have checked Google Chrome and MS Edge. Same result.
I tried swiching profiles (only with FireFox). Same result.
I tried to acess a previously opened FireFox session where I manually logged in by using this code snippet:
_WD_Option('Driver', 'C:\Path\to\the\executable\geckodriver.exe') _WD_Option('DriverParams', '--log trace --connect-existing  --marionette-port 2828') _WD_Option('Port', 4444) Obviously I adjusted the path of the geckodriver.exe but it did not work at all on my computer.
So far my code is really basically nothing but I can not even start to code. I myself am not a real coder and I know only the very basics like loops, conditions and variables.
----------------------------------------
; Script Start #include <Array.au3> #include <AutoItConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <File.au3> #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <StaticConstants.au3> #include "wd_core.au3" #include "wd_helper.au3" #include <WindowsConstants.au3> Local $sDesiredCapabilities,$sSession, $sElement SetupGecko()$_WD_DEBUG = $_WD_DEBUG_None _WD_Startup()$sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.ebay-kleinanzeigen.de/m-meine-anzeigen.html?sort=CREATION_DATE_ASC&keyword=winter") Exit Func SetupGecko() _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace --marionette-port 2828') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-profile", "' & "C:/Users/myaccount/AppData/Roaming/Mozilla/Firefox/Profiles/0123456.default-release" & '"],"log": {"level": "trace"}}}}}' EndFunc ;==>SetupGecko Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"')$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}' EndFunc ;==>SetupChrome Func SetupEdge() _WD_Option('Driver', 'msedgedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\msedge.log"') \$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & StringReplace(@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false}}}}' EndFunc ;==>SetupEdge --------------------------------------
I left the three setup functions in, because I do not care what browser I use as long as I can start coding.
Also, please understand that I am not trying to be lazy here. I do not want someone to code for me. Maybe the problem is very basic, but I just do not know how to eliminate that restriction.
Is it something I need to uncheck in the browser settings or is it more complicated? If you need more information, I will be happy to provide those.
If somebody has an idea or a solution, I would very much appreciate it.

Edit:
I am not bothered by the robot icon itself. I do not care about it.  If I try to acess my regular ebay account: "https://mesg.ebay.de/mesgweb/ViewMessages/0" it works like a charm despite the notification that the browser is remotely controlled.
My problem is, that the first website does not load for some reason ONLY when the browser is remote controlled.
• By FUD
hello
please i need help
i need to open link in default browser only one windows without duplicate if i try to open the same link

thanks
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...