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

I suppose it would be easier for you to attempt to locate the issue if I posted the correct code:

<script type='text/discourse-plugin' version='0.8.19'>
api.onPageChange((url) => {
	if (url.includes('/c/redirect-politifora')) {
		window.location.replace('https://politifora.com/');
	}
});
</script>

@vinothkannans