From 8b61683f9ea3ebbfc4658fb3effc82f0a9eb7d47 Mon Sep 17 00:00:00 2001
From: Genbu Hase <hasegenbu@gmail.com>
Date: Mon, 24 Sep 2018 12:45:58 +0900
Subject: [PATCH] Fix a problem about generating an url of notifications
 (#8758)

---
 .../mastodon/service_worker/web_push_notifications.js           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/javascript/mastodon/service_worker/web_push_notifications.js b/app/javascript/mastodon/service_worker/web_push_notifications.js
index d61d916b1..80a4fb329 100644
--- a/app/javascript/mastodon/service_worker/web_push_notifications.js
+++ b/app/javascript/mastodon/service_worker/web_push_notifications.js
@@ -168,7 +168,7 @@ const openUrl = url =>
 
       if (webClients.length !== 0) {
         const client       = findBestClient(webClients);
-        const { pathname } = new URL(url);
+        const { pathname } = new URL(url, self.location);
 
         if (pathname.startsWith('/web/')) {
           return client.focus().then(client => client.postMessage({