# Enable Dev Tools Button

**URL:** https://meta.discourse.org/t/enable-dev-tools-button/350803
**Category:** Theme component
**Created:** [February 6, 2025, 5:15am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803 "2025-02-06T05:15:40Z")
**Posts on this page:** 14
**Page:** 1

<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: [February 6, 2025, 5:15am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/1 "2025-02-06T05:15:41Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Summary** | Adds a button to the site header to enable Dev Tools |
| 👓 | **Preview** | [https://discourse.theme-creator.io/theme/NateDhaliwal/enable-dev-tools-button](https://discourse.theme-creator.io/theme/NateDhaliwal/enable-dev-tools-button) |
| 🛠 | **Repository** | [GitHub - NateDhaliwal/Enable-Dev-Tools-Button · GitHub](https://github.com/NateDhaliwal/Enable-Dev-Tools-Button) |
| ❓ | **Install Guide** | [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

This Theme Component adds a button to the site header to enable the [Developer Tools](https://meta.discourse.org/t/introducing-discourse-developer-toolbar/346215). When Dev Tools are not enabled, the button is the normal `bug` icon. When it is enabled, it is at the `bug-slash` icon.

Before enabling:  
 ![image](https://global.discourse-cdn.com/meta/original/4X/f/b/d/fbd8cfee4b2ab8322a95bf0c37c5370c47404b4e.png)

After enabling:  
 ![image](https://global.discourse-cdn.com/meta/original/4X/6/c/8/6c88da6fb1205b18a2697f3a8986aba3c2581eb2.png)

The button should remain at its respective state even when the page is closed, as it uses `localStorage`.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [February 7, 2025, 6:29am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/2 "2025-02-07T06:29:51Z")

</div>

On my instance it seems to show for non admin users. Could this be adjusted for admin only?

It is also showing on the right of profile. Guessing maybe due to f-nav theme component

 ![The image shows a screenshot of the interface of the game "Xropicstonis," featuring a dark background with the game title displayed prominently at the top. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/2/c/d/2cdb21c68f92441f96d852d56aa049d3c5ebd4c7.png)

---

<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: [February 7, 2025, 10:09am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/3 "2025-02-07T10:09:18Z")

</div>

> [@Heliosurge](#):
>
> On my instance it seems to show for non admin users. Could this be adjusted for admin only?

Yep, new setting `admin_only` has been added. I got some of it from [here](https://meta.discourse.org/t/deprecated-plugin-outlet-locations-theme-component/100673).

> [@Heliosurge](#):
>
> It is also showing on the right of profile. Guessing maybe due to f-nav theme component

I’ve specified it to be before the search button already. Probably a component affecting this.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [February 7, 2025, 7:39pm UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/4 "2025-02-07T19:39:16Z")

</div>

Thank you very kindly

The TC that will be affecting is very likely

> [@F NAV - Mobile Navigation Tabs](https://meta.discourse.org/t/f-nav-mobile-navigation-tabs/342277):
>
> information_sourceSummary F NAV - Mobile Navigation TabseyeglassesPreview [Theme Creator](https://discourse.theme-creator.io/theme/Don/f-nav-component)hammer_and_wrenchRepository [GitHub - VaperinaDEV/f-nav-for-mobile: F NAV - Mobile Navigation Tabs · GitHub](https://github.com/VaperinaDEV/f-nav-for-mobile)questionInstall Guide [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Hello wave Before, I have created a #Development [topic](https://meta.discourse.org/t/f-nav-theme-component-concept/340226) for it as a theme component concep…

It moves the search and chat a a few other goodies to a bottom bar. Not a big deal. As the Dev bar when active is a bit busy compared to the old TC plugin outlets in mobile.

---

<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: [February 8, 2025, 8:53am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/5 "2025-02-08T08:53:44Z")

</div>

Pushed a quick fix to add a setting (`logged_in_only`) to show the button to logged in users. It’s `true` by default.

---

<div class="post-metadata">

### Author: ![Andrew\_Rowe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_rowe/32/445877_2.png) [@Andrew\_Rowe](https://meta.discourse.org/u/Andrew_Rowe)
#### Post date: [May 4, 2025, 4:12pm UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/6 "2025-05-04T16:12:20Z")

</div>

For some reason, I don’t see the button after installing this component, everytime this happens it seems I’ve missed something little 🙄

I have the Custom Header Links component installed but I disabled it and the Dev Tools Button still didn’t appear

I reloaded the page several times and even logged out and back in (since I have it set to admin only)

latest Discourse just updated

---

<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: [May 5, 2025, 2:37am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/7 "2025-05-05T02:37:03Z")

</div>

I noticed this the last time as well. I think the icon is the same colour as the header, for some reason. IIRC it’s there, upon inspection.

It’s odd. IIRC if you enable then disable it, the button appears again. I’ll see what I can do.

---

<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: [May 5, 2025, 4:50am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/8 "2025-05-05T04:50:38Z")

</div>

@Andrew_Rowe I’ve pushed a fix. Try it and tell me if it works now, thanks!

---

<div class="post-metadata">

### Author: ![Andrew\_Rowe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_rowe/32/445877_2.png) [@Andrew\_Rowe](https://meta.discourse.org/u/Andrew_Rowe)
#### Post date: [May 5, 2025, 10:20am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/9 "2025-05-05T10:20:10Z")

</div>

Yup… it works now!!! Had to update the component. Thanks Nate

---

<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: [May 5, 2025, 10:43am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/10 "2025-05-05T10:43:58Z")

</div>

No problem!

---

<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: [June 14, 2025, 11:06pm UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/11 "2025-06-14T23:06:58Z")

</div>

I will be updating this soon to make it into a gjs file instead of a js/hbs one.

---

<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: [August 25, 2025, 11:26am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/12 "2025-08-25T11:26:54Z")

</div>

I’ve just merged in a PR that fixes the logic related to the `admin_only` setting. The setting should now function properly. Somehow I missed this bug for _quite_ a while.  
[https://github.com/NateDhaliwal/Enable-Dev-Tools-Button/pull/1](https://github.com/NateDhaliwal/Enable-Dev-Tools-Button/pull/1)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [January 2, 2026, 3:26pm UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/13 "2026-01-02T15:26:31Z")

</div>

I see this tc throws errors when one is not logged in because of a wrong order of expressions

`if (settings.admin_only && currentUser.admin && currentUser !== null) {`

evaluates `currentUser.admin` even if `currentUser` is null. It should be

`if (settings.admin_only && currentUser && currentUser.admin) {`

---

<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: [January 3, 2026, 3:56am UTC](https://meta.discourse.org/t/enable-dev-tools-button/350803/14 "2026-01-03T03:56:01Z")

</div>

I’ve updated it, thanks!
