Reply appreciated. I feel we are getting closer.
With the new code I have the same result as above. Upon testing out variations of the code, when only using the following JS it removes the imagebox/hash:
Code: |
if (!history.state || !history.state.fakeLightbox || history.state.path !== window.location.pathname) {
history.pushState({fakeLightbox: true, path: window.location.pathname}, null, window.location.pathname);
}
|
When simplifying it further (to just the single line of code) this too removes the imagebox/hash:
Code: |
history.pushState({fakeLightbox: true, path: window.location.pathname}, null, window.location.pathname);
|
So it would appear the issue is on the 5th line of the JS code. When using your latest JS code but stripping out the following JS, the linked image.jpg imagebox/hash works but doesn't have the back button support:
Code: |
if (!history.state || !history.state.fakeLightbox || history.state.path !== window.location.pathname) {
history.pushState({fakeLightbox: true, path: window.location.pathname}, null, window.location.pathname);
}
|