Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Not handling popup blockers on initial load #228

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/day8/re_frame_10x/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,16 @@
;; control over this, it will only position it within the same display that it was popped out on.
w (js/window.open "about:blank" "re-frame-10x-popout"
(str "width=" width ",height=" height ",left=" left ",top=" top
",resizable=yes,scrollbars=yes,status=no,directories=no,toolbar=no,menubar=no"))

d (.-document w)]
(when-let [el (.getElementById d "--re-frame-10x--")]
(r/unmount-component-at-node el))
(.open d)
(.write d new-window-html)
(goog.object/set w "onload" #(mount w d))
(.close d)))
",resizable=yes,scrollbars=yes,status=no,directories=no,toolbar=no,menubar=no"))]
(if-not w
(js/console.error "CANNOT OPEN re-frame-10x DEBUGGER WINDOW! Allow pop-ups from this URL.")
(let [d (.-document w)]
(when-let [el (.getElementById d "--re-frame-10x--")]
(r/unmount-component-at-node el))
(.open d)
(.write d new-window-html)
(goog.object/set w "onload" #(mount w d))
(.close d)))))

(rf/reg-event-fx
:global/launch-external
Expand Down