diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 553df4940..ee19601a4 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -8332,8 +8332,6 @@ clean: function() { var age, name, pruned, uid, _ref, _ref1; pruned = false; - c.log('cleaning'); - c.log(Object.keys(Conf.CachedTitles).length); _ref = Conf['CachedTitles']; for (uid in _ref) { _ref1 = _ref[uid], name = _ref1[0], age = _ref1[1]; @@ -8343,8 +8341,6 @@ pruned = true; delete Conf['CachedTitles'][uid]; } - c.log(Object.keys(Conf.CachedTitles).length); - c.log('cleaned'); if (pruned) { return $.set('CachedTitles', Conf['CachedTitles']); } @@ -16292,8 +16288,8 @@ if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) { return; } + $.on(window, 'popstate', Navigate.popstate); $.ready(function() { - $.on(window, 'popstate', Navigate.popstate); Navigate.makeBreadCrumb(window.location, g.VIEW, g.BOARD.ID, g.THREADID); return $.add(Index.navLinks, Navigate.el); }); @@ -16560,7 +16556,7 @@ } Navigate.makeBreadCrumb(this.href, view, boardID, threadID); if (this.id !== 'popState') { - history.pushState(null, '', path); + history.pushState('internal', '', path); } Navigate.path = this.pathname; Navigate.setMode(this); diff --git a/builds/crx/script.js b/builds/crx/script.js index 9210a9780..f9d6168d2 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -8383,8 +8383,6 @@ clean: function() { var age, name, pruned, uid, _ref, _ref1; pruned = false; - c.log('cleaning'); - c.log(Object.keys(Conf.CachedTitles).length); _ref = Conf['CachedTitles']; for (uid in _ref) { _ref1 = _ref[uid], name = _ref1[0], age = _ref1[1]; @@ -8394,8 +8392,6 @@ pruned = true; delete Conf['CachedTitles'][uid]; } - c.log(Object.keys(Conf.CachedTitles).length); - c.log('cleaned'); if (pruned) { return $.set('CachedTitles', Conf['CachedTitles']); } @@ -16308,11 +16304,16 @@ Navigate = { path: window.location.pathname, init: function() { + var popstateHack; if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) { return; } + popstateHack = function() { + $.off(window, 'popstate', popstateHack); + return $.on(window, 'popstate', Navigate.popstate); + }; + $.on(window, 'popstate', popstateHack); $.ready(function() { - $.on(window, 'popstate', Navigate.popstate); Navigate.makeBreadCrumb(window.location, g.VIEW, g.BOARD.ID, g.THREADID); return $.add(Index.navLinks, Navigate.el); }); @@ -16579,7 +16580,7 @@ } Navigate.makeBreadCrumb(this.href, view, boardID, threadID); if (this.id !== 'popState') { - history.pushState(null, '', path); + history.pushState('internal', '', path); } Navigate.path = this.pathname; Navigate.setMode(this); diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 6b5c8d4b1..a7f914b8b 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -3,9 +3,18 @@ Navigate = init: -> return if g.BOARD.ID is 'f' or !Conf['JSON Navigation'] + <% if (type === 'crx') { %> + # blink/webkit throw a popstate on page load. Not what we want. + popstateHack = -> + $.off window, 'popstate', popstateHack + $.on window, 'popstate', Navigate.popstate + + $.on window, 'popstate', popstateHack + <% } else { %> + $.on window, 'popstate', Navigate.popstate + <% } %> + $.ready -> - # blink/webkit throw a popstate on page load. Not what we want. - $.on window, 'popstate', Navigate.popstate Navigate.makeBreadCrumb window.location, g.VIEW, g.BOARD.ID, g.THREADID $.add Index.navLinks, Navigate.el @@ -221,7 +230,7 @@ Navigate = Navigate.makeBreadCrumb @href, view, boardID, threadID - history.pushState null, '', path unless @id is 'popState' + history.pushState 'internal', '', path unless @id is 'popState' Navigate.path = @pathname Navigate.setMode @