Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

what about if I place some JavaScript that looks at the url  the web game is on, and if it's not www.itch.io  stops the the game from running would something like that work?

(+3)

I advise against implementing drm without a very good reason. You will hurt your legit players first and hardest.

There is a current thread somewhere, that itch is moving servers behind the scenes. If you are unlucky, your homebrew drm will brick your own game.

A much simpler solution is to unmistakenly tell the player where the game is hosted, so the player knows, something "unofficial" is going on. It is much harder to automatically remove watermarks from assets, that tell players where the game should be. But url misdirections and checks can very likely automatically be corrected for the use case you are concerned about.