From 424c252eb0f81850aaf9f541d955562e26e2a591 Mon Sep 17 00:00:00 2001 From: Matthew James Davis Date: Fri, 9 Feb 2018 23:35:25 +0900 Subject: [PATCH] fix(history-browser): Add location.href to replaceState() call There is currently a bug in Safari that doesn't properly handle the optional third parameter to the replaceState(state, title, url) function when a tag is present on the page. This fix explicitly sets the url property to the location.href value. Thanks to @powerbuoy @huochunpeng and @jwx for helping diagnose this issue! Closes https://github.com/aurelia/history-browser/issues/34 https://github.com/aurelia/router/issues/574 --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 05b6b0e..879db2e 100644 --- a/src/index.js +++ b/src/index.js @@ -189,7 +189,7 @@ export class BrowserHistory extends History { setState(key: string, value: any): void { let state = Object.assign({}, this.history.state); state[key] = value; - this.history.replaceState(state, null, null); + this.history.replaceState(state, null, this.location.href); } /**