new Edge (Dev) browser tips - Forum

Forum Navigation
Climate strike banner
You need to log in to create posts and topics.

new Edge (Dev) browser tips

Microsoft has released a new version of the Edge (Dev) browser that uses the Google chromium rendering engine. https://developer.microsoft.com/en-us/microsoft-edge/ It takes the same commands and switches as the Chrome browser. In this example it is run in a rectangle named "ChromeBrowser1" found in "ChromeContainer"

Here is how to locate Edge:

StrReplace "[ProgramFiles]" "Program Files (x86)" "Program Files" "[ProgramFilesWOW64]" ""
FileExists "[ProgramFilesWOW64]\Microsoft\Edge Dev\Application\msedge.exe" "[i]"
.AlertBox "Find Chrome" "Is Chrome in Program Files?||[i]"
If "[i]" "=" "True"
SetVar "[ChromePath]" "[ProgramFilesWOW64]Microsoft\Edge Dev\Application\msedge.exe"
.AlertBox "Chrome Path" "Chrome Path set to [ProgramFilesWOW64]Microsoft\Edge Dev\Application\msedge.exe"
.Return
EndIf

. Search Program Files x86
FileExists "[ProgramFiles]\Microsoft\Edge Dev\Application\msedge.exe" "[i]"
.AlertBox "Find Chrome" "Is Chrome in Program Files x86?||[i]"
If "[i]" "=" "True"
SetVar "[ChromePath]" "[ProgramFiles]Microsoft\Edge Dev\Application\msedge.exe"
.AlertBox "Chrome Path" "Chrome Path set to [ProgramFiles]Microsoft\Edge Dev\Application\msedge.exe"
.Return
EndIf

. Search Vista AppData Local
StrReplace "[ProgramFiles]" "Program Files (x86)" "Users\[UserName]" "[UserDrive]" ""
.AlertBox "" "[UserDrive]"
FileExists "[UserDrive]\AppData\Local\Microsoft\Edge Dev\Application\msedge.exe" "[i]"
.AlertBox "Find Chrome" "Is Chrome in AppData Local?||[i]"
If "[i]" "=" "True"
SetVar "[ChromePath]" "[UserDrive]AppData\Local\Microsoft\Edge Dev\Application\msedge.exe"
.AlertBox "Chrome Path" "Chrome Path set to [UserDrive]AppData\Local\Microsoft\Edge Dev\Application\msedge.exe"
.Return

Here is how to initialize Edge: (Otherwise it takes too long to load the first time and might timeout your application.)

SetVar "[iL]" "[PubLeft]"
SetVar "[iT]" "[PubTop]"
GetObjectInfo "ChromeContainer" "Width" "[iW]"
GetObjectInfo "ChromeContainer" "Height" "[iH]"
RunInRectangle "ChromeBrowser1" "[ChromePath]" "--window-position=[iL],[iT] --window-size=[iW],[iH] --headless --app=about:blank" "" "ShowHelp" "[ChromeRectangle1]"

(the  --app=   switch hides the browser address bar )

Here is how to run Edge:

Run "[ChromePath]" "[RunChromeFlags]--window-position=[iL],[iT] --window-size=[iW],[iH] --app=mywebsite.com" "Normal" "" "[ChromeID]"

Here is how to run Edge in a rectangle:

RunInRectangle "ChromeBrowser1" "[ChromePath]" "--window-position=[iL],[iT] --window-size=[iW],[iH] --app=mywebsite.com" "" "ShowHelp" "[ChromeID]"

Here is how to close Edge:

Run "cmd.exe" "/c taskkill /f /im msedge.exe" "Hidden" "" ""
Delay "1000"
CloseApp "[ChromeID]" "RequestClose"
Delay "200"
CloseApp "[ChromeID]" "ForceClose"