Enable Dev Tools Button

:information_source: Summary Adds a button to the site header to enable Dev Tools
:eyeglasses: Preview Theme Creator
:hammer_and_wrench: Repository GitHub - NateDhaliwal/Enable-Dev-Tools-Button
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

This Theme Component adds a button to the site header to enable the Developer Tools. 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

After enabling:
image

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

7 Likes

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

1 Like

Yep, new setting admin_only has been added. I got some of it from here.

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

2 Likes

Thank you very kindly

The TC that will be affecting is very likely

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.

1 Like

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

2 Likes

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

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

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.

2 Likes

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

2 Likes

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

2 Likes

No problem!