# How to get around DOMContentLoaded for navigation?

**URL:** https://meta.discourse.org/t/how-to-get-around-domcontentloaded-for-navigation/351748
**Category:** Development
**Created:** [February 11, 2025, 9:38pm UTC](https://meta.discourse.org/t/how-to-get-around-domcontentloaded-for-navigation/351748 "2025-02-11T21:38:15Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 11, 2025, 11:18pm UTC](https://meta.discourse.org/t/how-to-get-around-domcontentloaded-for-navigation/351748/6 "2025-02-11T23:18:36Z")

</div>

> [@ddsgad](#):
>
> the plugin API is legacy and will be deprecated soon

I don’t believe that is correct.

> [@Using the JS API](https://meta.discourse.org/t/using-the-pluginapi-in-site-customizations/41281):
>
> Discourse’s JavaScript API allows themes and plugins to make extensive customizations to the user experience. The simplest way to use it is to create a new theme from the admin panel, click “Edit Code”, and then head to the JS tab. For file-based themes, the API can be used by creating a file in the api-initializers directory. For theme’s that’s {theme}/javascripts/api-initializers/init-theme.gjs, and for plugins, it’s {plugin}/assets/javascripts/discourse/api-initializers/init-plugin.js. The c…

was updated last week.

What is deprecated are:

- widget API
- Raw templates
- Overriding templates in general

---

_[View the full topic](https://meta.discourse.org/t/how-to-get-around-domcontentloaded-for-navigation/351748)._
