From b408e0bc532e6023248c6671c5cef52d1c06f3f3 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Fri, 30 May 2014 04:53:19 -0400 Subject: [PATCH] Display a warning if popup window was blocked (#1489618) --- program/js/app.js | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 914bb02..cd0737e 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -685,9 +685,6 @@ form.target = win.name; form.submit(); } - else { - // this.display_message(this.get_label('windowopenerror'), 'error'); - } } else { this.open_window(this.env.permaurl, true); @@ -1780,6 +1777,13 @@ +(toolbar ? ',toolbar=yes,menubar=yes,status=yes' : ',toolbar=no,menubar=no,status=no')); } + // detect popup blocker (#1489618) + // don't care this might not work with all browsers + if (!extwin || extwin.closed) { + this.display_message(this.get_label('windowopenerror'), 'warning'); + return; + } + // write loading... message to empty windows if (!url && extwin.document) { extwin.document.write('<html><body>' + this.get_label('loading') + '</body></html>'); -- Gitblit v1.9.1