Ref #3465: Another update on javascript popup management