Posts: 12,095
Threads: 142
Joined: Dec 2002
07-18-2017, 07:45 AM
(This post was last modified: 12-13-2024, 07:14 AM by Gintaras.)
The Chrome web browser supports accessible objects in web pages, but this is disabled by default. QM tries to auto-enable it on demand, but with some Chrome versions it fails (always or in some cases).
You can explicitly enable Chrome accessible objects: run chrome.exe with command line --force-renderer-accessibility. Before it make sure there are no hidden chrome.exe processes.
run "chrome.exe" "--force-renderer-accessibility"
The alternative way (code deleted) no longer works. Use the above way.
Posts: 58
Threads: 20
Joined: Aug 2019
Hello Gintaras,
Is there a similar function to enable_chrome_acc_t that can be applied to Microsoft Edge browser?
I came across a problem where objects on Microsoft Edge are inaccessible, and only become accessible once using the ''find accessible objects'' dialog from QM
Posts: 12,095
Threads: 142
Joined: Dec 2002
08-25-2022, 04:24 AM
(This post was last modified: 12-13-2024, 07:16 AM by Gintaras.)
Maybe you use an old QM version. Current version auto-enables Edge objects.
Tested with this code:
int w=wait(3 WV win("- Microsoft Edge" "Chrome_WidgetWin_1"))
Acc a.Find(w "LINK" "QM3 preview" "" 0x3001 3)
out a.Name
Also try this new program. It finds Chrome and Edge objects ~30 times faster. Auto-enables objects better than QM.
https://www.libreautomate.com/
Posts: 58
Threads: 20
Joined: Aug 2019
Thank you for your quick response!
I work at a place where upgrading to the latest QM would likely not be possible.
They are running QM version 2.4.2.2
Is there any way to still get those accessible objects from Edge? What code does the "Accessible objects actions" dialog in QM run in the background to make this possible?
Thanks in advance
Posts: 12,095
Threads: 142
Joined: Dec 2002
The dialog just uses API to get "object from mouse position". Then Edge enables objects. But Edge does not enable objects when something uses API for finding objects.
Function
EnableChromeAcc
function [w]
;Enables accessible objects in Chrome or Edge.
;w - browser window handle. If 0, this function tries to find Chrome or Edge.
if !w
,w=win("Google Chrome" "Chrome_WidgetWin_1")
,if !w
,,w=win("Microsoft Edge" "Chrome_WidgetWin_1")
,,if(!w) end "Browser window not found"
int c=child("" "Chrome_RenderWidgetHostHWND" w)
if(!c) end "Browser child window not found"
SendMessage(c WM_GETOBJECT 0 1)
Acc a.FromWindow(c OBJID_CLIENT)
rep 100
,int n=a.ChildCount
,if(n>0) break
,a.Name
,a.a.DefaultAction(0)
,0.02
Posts: 58
Threads: 20
Joined: Aug 2019
That works! Thank you so much!