mirror of
https://github.com/srid/ema.git
synced 2024-11-29 09:25:14 +03:00
websocket: don't handle target=_blank links
For https://github.com/srid/emanote/issues/129
This commit is contained in:
parent
22512991a8
commit
e2444a4c24
@ -10,6 +10,7 @@
|
||||
- Scroll to top on route switches
|
||||
- Use secure websockets when on HTTPS
|
||||
- Bind to loopback (127.0.0.1) for security reasons
|
||||
- Do not handle target=_blank links in websocket route switch
|
||||
- `Asset` type
|
||||
- Introduce the `Asset` type to distinguishing between static files and generated files. The later can be one of `Html` or `Other`, allowing the live server to handle them sensibly.
|
||||
- `Ema` typeclass:
|
||||
|
@ -273,7 +273,7 @@ wsClientShim =
|
||||
function handleRouteClicks(e) {
|
||||
const origin = e.target.closest("a");
|
||||
if (origin) {
|
||||
if (window.location.host === origin.host) {
|
||||
if (window.location.host === origin.host && origin.getAttribute("target") != "_blank") {
|
||||
window.history.pushState({}, "", origin.pathname);
|
||||
switchRoute(origin.pathname);
|
||||
e.preventDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user