1
1
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:
Sridhar Ratnakumar 2021-09-26 11:52:14 -04:00
parent 22512991a8
commit e2444a4c24
2 changed files with 2 additions and 1 deletions

View File

@ -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:

View File

@ -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();