From 8718da35c6f6efcff75ea51acb5e02556284ed57 Mon Sep 17 00:00:00 2001 From: Robin North Date: Sun, 28 Jan 2018 14:35:25 +0000 Subject: [PATCH] Opt in to manual scroll restoration in browsers that support it --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index b6a35d5..a8a00db 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,10 @@ var Pjax = function(options) { parseOptions.apply(this,[options]) this.log("Pjax options", this.options) + if (this.options.scrollRestoration && "scrollRestoration" in history) { + history.scrollRestoration = "manual" + } + this.maxUid = this.lastUid = newUid() this.parseDOM(document) -- 2.49.1