Refactor hack to open options in not modal window
Also now correctly works without window.opener