-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetTab and CloseTab: Unable to get tab elements (Vivaldi) #46
Comments
I am unable to reproduce this in Windows 10 running latest Vivaldi. Could you post the output of
|
With further testing I confirm - the error is not really reproducible (any more!) ... Very strange. For reference, I still post the TabBarElement.DumpAll() below with two tabs open, Maybe you can still detect something odd there? I have to admit that normally I have around 30 tabs open with many being "Tab Stacks" with a bunch of sub-tabs, maybe this is also part of the original issue? Furthermore, I have simplified my script to below code, it reloads the current active tab, opens a NewTab and closes the new tab again. Is it normal, that such long Sleep is neccessary? Any Sleep below ~700 ms wrongly closes the current active tab and not the NewTab (which should be captured in the variable "hello")... Would it be possible to detect the NewTab to be fully "loaded" so that the variable always contains the correct reference and CloseTab works "as fast as possible" as well as in different CPU load conditions? For the actual issue posted above, for now this is indeed "gone".
TabBarElement.DumpAll():
|
So I did find a minor bug in With Vivaldi the problem is that we can't detect which tab is active with UIA. UIA_Browser uses a work-around for that: it extracts the tab name from the window title and then searches for a tab with that name. However, that method will fail if you create a tab and then very quickly try to access it, because the window title will not have had time to change yet. You can work around that by specifying the newly created tab name, which in Vivaldi is "Start Page". Try this:
|
Understood and thanks so much for your debugging efforts! The NewTab / CloseTab("Start Page") works - but only with a Sleep 700+ ms in between. Don't know if it helps, I guess you probably cannot circumvent this - but FYI this error is thrown without (or too short) sleep. Sounds like a "prototype-function" is used, is this all as expected?
|
Using Vivaldi browser, the below script fails with the message "Please file a bug report"
Symptom: NewTab() works fine but GetTab() fails.
I'm using the latest UIA_Browser library and I have initialized cUIA := UIA_Browser()
Additional info: allnames := cUIA.GetAllTabNames() works fine. As a workaround I tried CloseTab(allnames[1]) on my target Tab but here CloseTab failed as well, same error message as below. Looks like this issue is connected to the same root cause? Thanks for looking into this.
Error: Unable to get tab elements
Specifically: Please file a bug report
002: cUIA.NewTab()
003: Sleep(500)
▶ 004: hello := cUIA.GetTab()
005: Sleep(500)
006: cUIA.CloseTab(hello)
The current thread will exit.
What I actually want to achieve is "simply" this: NewTab --> wait 500 ms --> (reliably) close the newly opened tab again, while making sure not to close any other tab.
The text was updated successfully, but these errors were encountered: