From 0d643111a292c777ae607e0252464ec7af1a2d88 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 7 Sep 2018 17:45:03 -0400 Subject: [PATCH] Fix querystring in context when navigating to the same page When navigating to the current page, include the querystring as part of the Context. Fixes #495 --- index.js | 2 +- page.js | 2 +- page.mjs | 2 +- test/demos/back-demo.html | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 test/demos/back-demo.html diff --git a/index.js b/index.js index 1ab9108a..194f2876 100755 --- a/index.js +++ b/index.js @@ -448,7 +448,7 @@ page.replace(path, e.state); } else if (isLocation) { var loc = page._window.location; - page.show(loc.pathname + loc.hash, undefined, undefined, false); + page.show(loc.pathname + loc.search + loc.hash, undefined, undefined, false); } }; })(); diff --git a/page.js b/page.js index 01757288..668c645e 100644 --- a/page.js +++ b/page.js @@ -848,7 +848,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; page.replace(path, e.state); } else if (isLocation) { var loc = page._window.location; - page.show(loc.pathname + loc.hash, undefined, undefined, false); + page.show(loc.pathname + loc.search + loc.hash, undefined, undefined, false); } }; })(); diff --git a/page.mjs b/page.mjs index 8cf11b1d..7b9fe8d4 100644 --- a/page.mjs +++ b/page.mjs @@ -842,7 +842,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; page.replace(path, e.state); } else if (isLocation) { var loc = page._window.location; - page.show(loc.pathname + loc.hash, undefined, undefined, false); + page.show(loc.pathname + loc.search + loc.hash, undefined, undefined, false); } }; })(); diff --git a/test/demos/back-demo.html b/test/demos/back-demo.html new file mode 100644 index 00000000..3dbbc0aa --- /dev/null +++ b/test/demos/back-demo.html @@ -0,0 +1,15 @@ + + +Blank page + + + + + +