Currently findWin only goes 1 level deep - for a window it gets, it goes through all frames underneath it, but not the frames underneath them.
This PR turns findWin into a recursive function, allowing it to always start from the top and go through all existing windows in the page (regardless of their depth level) until it finds its match.
Currently
findWin
only goes 1 level deep - for a window it gets, it goes through all frames underneath it, but not the frames underneath them.This PR turns
findWin
into a recursive function, allowing it to always start from thetop
and go through all existing windows in the page (regardless of their depth level) until it finds its match.