Unfortunately that's not a solution, because the callback can be inside an iFrame. In that case, your solution won't work