We have tested both the javascript method and the "CPcmdexit =1" method with the module published on the client LMS and both are working. It could be perfect if the time between the click and the module actually close was not so long (3-4 seconds).
Tahnk you Anjaneai for your help.
Kind regards,
Vincent