Can custom code in the global body area be hidden on the home page by default?

In this area of webflow, we are inserting javascript into the footer code area:
/dashboard/sites/ $sitename /code

This script activates a premium feature that I do not want to display on the default home page.

Is it possible to prevent that script from loading on the home page?

Written out logically, this is something like what I would want to do:

IfHomePage = false {
#not home page, lets embed the script
<script>...</script>
}

HI @insight you can try window.location() method like

if (window.location.pathname=='/') {
    // do some stuff
}

here is one article

and here official doc