From c2eede2bb57f939481401379800c3991a6d6c7b2 Mon Sep 17 00:00:00 2001 From: Aaron van Meerten Date: Fri, 3 Jun 2016 13:00:09 -0500 Subject: [PATCH] Only push to history with present page URL plus room name Use location.href instead of location.pathname to make the URL absolute --- app.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app.js b/app.js index 6778fd109..1f84d4b3c 100644 --- a/app.js +++ b/app.js @@ -51,14 +51,9 @@ function buildRoomName () { if(!roomName) { let word = RoomnameGenerator.generateRoomWithoutSeparator(); roomName = word.toLowerCase(); - let historyURL = window.location.pathname + word; - //Trying to push state with URL "/" + roomName - var err = pushHistoryState(word, historyURL); - //If URL "/" + roomName is not good, trying with explicitly adding the - //domain name. - if(err && config.hosts.domain) { - pushHistoryState(word, "//" + config.hosts.domain + historyURL); - } + let historyURL = window.location.href + word; + //Trying to push state with current URL + roomName + pushHistoryState(word, historyURL); } return roomName;