This seems a bit 'loose' if you don't mind me saying - I checked this condition and it would seem to return `true` regardless of which app is opened.

I think it might be worth checking that the correct app has opened by switching into the frame first and then traversing up from there?