It was working when I tested it in the editor, but I changed it so that it is passed the iframe's document as a parameter just to be sure.