For my research I use IEEExplore, which serves up PDF files inside of a FRAME (part of a FRAMESET), because IEEE wants to show how I'm accessing its service through my library, and that "banner" info is showed in another FRAME at the top of the page.
Because of a limitation of Chrome (note, if you want encourage Google to fix it, go to that link and click the star button), Ctrl-F (Find...) searches only go to the top document (or the first FRAME). This is useless, as the PDF is in the second frame. It's very often one wants to search within a PDF file one has just opened.
The manual workaround in Chrome is to right-click on the PDF frame, then Inspect Element, which looks like
<frame src="http://example.com/abcd.pdf?...;isnumber=1234" frameborder="0">
then right-click the underlined http://example.com/abcd.pdf?...;
and Open in new tab
I was trying to write a bookmarklet (JavaScript inside a Bookmark) in Chrome that would basically automate this process.
I found jQuery: Access frame in nested frameset, but I'm stuck at how to get the src=
attribute for an unnamed frame.
I found an answer thanks to a great blog by Iain Hoult. Since the IEEExplore's PDF is in the second (of two) frames (starting at 0), you just set the current tab's URL to the location of the second frame.
The bookmark's URL is essentially:
javascript:(function(){window.location=$(window.parent.frames[1].document.location).attr('href');})();