All right now I get it.
Apparently, the Javascript updates the values of the parent window object (the parent's window form, wich is why I didn't see at first glance how to emulate the behavior in Perl).
So now that I know how the child frame js behaves, I'm able to emulate it in the parent ... (Dunno if it his clear).
Well at least now I know that there is a module that enables us to run embedded js code...