# Navigating to local URL fragment doesn't modify browser history

**URL:** <https://meta.discourse.org/t/navigating-to-local-url-fragment-doesnt-modify-browser-history/155624>\
**Category:** Product Support\
**Created:** [22 ביוני,‏ 2020,‏ 9:35pm UTC](https://meta.discourse.org/t/navigating-to-local-url-fragment-doesnt-modify-browser-history/155624 "2020-06-22T21:35:49Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![gar1t](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gar1t/32/380142_2.png) [@gar1t](https://meta.discourse.org/u/gar1t)\
**Post date:** [23 ביוני,‏ 2020,‏ 1:52pm UTC](https://meta.discourse.org/t/navigating-to-local-url-fragment-doesnt-modify-browser-history/155624/9 "2020-06-23T13:52:53Z")

</div>

I implemented a work-around (arguably a proper approach to customize a site given Discourse’s point-of-view on link navigation) via a theme component. This follows the pattern used by DiscoTOC where a marker is added to a post to trigger the behavior. The applicable code is [here](https://github.com/guildai/my-guild-ai-tweaks/blob/915cd2378896e9bb4cf636718bd4976b347b2e7f/common/header.html#L18-L33).

I think modifying DiscoTOC to use URL fragments and browser history is a good idea. This requires changing the component’s approach to navigation, which is not a minor change. DiscoTOC uses data attributes to pass along targets rather than link href’s. There’s no attempt to reflect the new page location in the browser URL (window.location).

I think the pattern I’m using above could work for DiscoTOC but that has broader implications for that component given its current approach.

---

_[View the full topic](https://meta.discourse.org/t/navigating-to-local-url-fragment-doesnt-modify-browser-history/155624)._
