0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 15:39:50 -05:00

🐛 Fix tab reuse issue (viewer <-> workspace).

This commit is contained in:
Andrey Antukh 2021-11-15 16:22:31 +01:00 committed by Andrés Moya
parent 6eac9102c9
commit abca69f408
2 changed files with 8 additions and 5 deletions

View file

@ -411,13 +411,15 @@
(let [event (.-nativeEvent ^js bevent)]
(= 1 (.-which event))))
;; Warning: need to protect against reverse tabnabbing attack
;; https://www.comparitech.com/blog/information-security/reverse-tabnabbing/
(defn open-new-window
([uri]
(open-new-window uri "_blank"))
(open-new-window uri "_blank" "noopener,noreferrer"))
([uri name]
;; Warning: need to protect against reverse tabnabbing attack
;; https://www.comparitech.com/blog/information-security/reverse-tabnabbing/
(.open js/window (str uri) name "noopener,noreferrer")))
(open-new-window uri name "noopener,noreferrer"))
([uri name features]
(.open js/window (str uri) name features)))
(defn browser-back
[]

View file

@ -117,9 +117,10 @@
(effect [_ state _]
(let [router (:router state)
path (resolve router rname path-params query-params)
name (or name "_blank")
uri (-> (u/uri cfg/public-uri)
(assoc :fragment path))]
(dom/open-new-window (str uri) name)))))
(dom/open-new-window uri name nil)))))
(defn nav-back
[]