This might not work in all browsers, but you should be able to find the correct iframe from `doc.defaultView.frames`, which is an array of direct subframes