diff --git a/modules/core/client/app/init.js b/modules/core/client/app/init.js index 33470bae9a..1ad7bb3959 100644 --- a/modules/core/client/app/init.js +++ b/modules/core/client/app/init.js @@ -46,8 +46,20 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(function ($ro //Then define the init function for starting up the application angular.element(document).ready(function () { //Fixing facebook bug with redirect - if (window.location.hash === '#_=_') { - window.location.hash = '#!'; + if (window.location.hash && window.location.hash === '#_=_') { + if (window.history && history.pushState) { + window.history.pushState('', document.title, window.location.pathname); + } else { + // Prevent scrolling by storing the page's current scroll offset + var scroll = { + top: document.body.scrollTop, + left: document.body.scrollLeft + }; + window.location.hash = ''; + // Restore the scroll offset, should be flicker free + document.body.scrollTop = scroll.top; + document.body.scrollLeft = scroll.left; + } } //Then init the app