# Run script only in certain categories?

**URL:** <https://meta.discourse.org/t/run-script-only-in-certain-categories/161947>\
**Category:** Support\
**Created:** [August 24, 2020, 9:48pm UTC](https://meta.discourse.org/t/run-script-only-in-certain-categories/161947 "2020-08-24T21:48:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)\
**Post date:** [August 24, 2020, 9:48pm UTC](https://meta.discourse.org/t/run-script-only-in-certain-categories/161947/1 "2020-08-24T21:48:35Z")

</div>

I have a script to disable right click on images which currently applies to the entire site, but I have some private categories where I would like it disabled, is there any way to do this with a script? Thanks!

```plaintext
<script type="text/discourse-plugin" version="0.8">
  api.onPageChange((url, title) => {
    $("img").bind("contextmenu",function(e) {
      return false;
    });
  });
</script>
  
<script type="text/discourse-plugin" version="0.8">

const TopicRoute = require("discourse/routes/topic").default;

TopicRoute.reopen({
	activate: function() {
		this._super();
		Em.run.next(function() {
		    $('body').on('contextmenu', '.cooked img, .mfp-img', function(e){ return false; });
		});
	}
});
</script>
```
