From 89dbba49f5658eea22f6f97b2749d53408f4c964 Mon Sep 17 00:00:00 2001 From: CylonicRaider Date: Tue, 31 Oct 2017 20:26:23 +0100 Subject: [PATCH] Fix page location reading in Chrome Chrome started setting the location of the iframe containing the bulk of the client code slightly differently to that one of the top-level window in some unknown version; the iframe does now not contain the fragment identifier of the top-level window, which some things (including custom themes and development the frontend against upstream backends) depended on. Ironically, a follow-up to 3ba8a2ec50efedbce41723392b7f9abe7ac5976f. --- client/lib/clientRoom.js | 2 +- client/lib/fauxPlugins.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/lib/clientRoom.js b/client/lib/clientRoom.js index d68c9f0e..27daa9eb 100644 --- a/client/lib/clientRoom.js +++ b/client/lib/clientRoom.js @@ -35,7 +35,7 @@ export default function clientRoom() { // read url hash flags pertaining to socket connection const roomName = uiwindow.location.pathname.match(/((pm:)?\w+)\/$/)[1] - const hashFlags = queryString.parse(location.hash.substr(1)) + const hashFlags = queryString.parse(uiwindow.location.hash.substr(1)) let connectEndpoint = process.env.HEIM_ORIGIN + process.env.HEIM_PREFIX if (process.env.NODE_ENV !== 'production' && hashFlags.connect) { connectEndpoint = hashFlags.connect diff --git a/client/lib/fauxPlugins.js b/client/lib/fauxPlugins.js index a7685f1e..c82017c7 100644 --- a/client/lib/fauxPlugins.js +++ b/client/lib/fauxPlugins.js @@ -366,7 +366,7 @@ export default function initPlugins(roomName) { Heim.chat.setRoomSettings({collapse: false}) } - if (location.hash.substr(1) === 'spooky') { + if (uiwindow.location.hash.substr(1) === 'spooky') { Heim.hook('page-bottom', () => { return (