PKBeam / AMWin-RP

A Discord Rich Presence client for Apple Music's native Windows app.
GNU General Public License v3.0
509 stars 27 forks source link

Interacting with certain UI elements of Apple Music causes the scraper to break #105

Closed 21mtd closed 1 week ago

21mtd commented 5 months ago

Version Info AMWin-RP v1.4.5 (region: VN) Apple Music 1.4.6.85 (1.1030.21762.0)

Describe the bug

Open a song context menu (right click or click ... of a song in a playlist) image or ... of the current song info image

Apple Music song panel is not initialised or missing bug appears in log, which also kills the RP.

This happens in previous AMWin versions too I think.

Log Files image

jwl-7 commented 5 months ago

This issue occurs after opening any context menu in Apple Music. The problem is Windows Automation UI will no longer find the "bridge" child window with the classname Microsoft.UI.Content.DesktopChildSiteBridge. I used inspect.exe to analyze the windows for any changes. When a context menu is opened, a new PopupHost pane appears as the very next child window under the main Apple Music window. While this appears to be the only tree structure change, you'll find that you cannot navigate to the 'bridge' window as a sibling from any other panel on the same level.

System Info:

PierreSchwang commented 4 months ago

I'm currently having similar issues and can reproduce that. Interestingly, using EnumChildWindows from the win32 API, I can at least find the window (though it takes tremendously longer). But I can't work with that window handle either. I'm using https://github.com/mmarquee/ui-automation and convert the HWND from JNA back into a Wrapper from the library but can't access any descendants whatsoever.

Using "Accessibility Insights for Windows" by Microsoft all Elements including their properties can still be accessed - so I guess it would be interesting to know how they resolve all elements and children. It is Open Source, but I'm not that fit in C# / .NET and have no idea where to look remotely: https://github.com/microsoft/accessibility-insights-windows

PKBeam commented 1 week ago

This should be fixed in the next release.

PKBeam commented 1 week ago

Fixed in 1.4.9.

Feel free to reopen if you still have this issue.