# How to Add a Floating Back Button in Discourse (For Mobile Users)

**URL:** <https://meta.discourse.org/t/how-to-add-a-floating-back-button-in-discourse-for-mobile-users/338623>\
**Category:** Development\
**Tags:** mobile\
**Created:** [November 27, 2024, 12:24am UTC](https://meta.discourse.org/t/how-to-add-a-floating-back-button-in-discourse-for-mobile-users/338623 "2024-11-27T00:24:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Post date:** [November 27, 2024, 1:00am UTC](https://meta.discourse.org/t/how-to-add-a-floating-back-button-in-discourse-for-mobile-users/338623/4 "2024-11-27T01:00:34Z")

</div>

For Chrome, you can swipe from the left edge to go back.  
On browsers, my phone’s back button also works. Does it work for you?  
IIRC you can use `api.onPageChange()` and then get the page url.  
See:

> <https://github.com/NateDhaliwal/discourse-confetti-clicks/blob/e602c0107e76eee2c5aba66ed60635c1d3751fdf/javascripts/discourse/initializers/confetti_topic-category.gjs#L7>

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-a-floating-back-button-in-discourse-for-mobile-users/338623)._
