How do you force a script to refire on every page load in Discourse?

Perhaps this is a better place to ask this question: I am currently attempting to use this API to trigger a redirection from a category to an external site (Redirect Category to External URL). For some reason, I cannot seem to get this API to trigger the script.

Here is the script I’m using:

<script type='text/discourse-plugin' version='0.8.19'>
$( document ).ready(function() {
	if ( window.location.href === "https://omnifora.com/c/redirect-politifora" ) {
		window.location.replace( "https://politifora.com/" );
	}
});
</script>