Let's say we have a JS code library that is not for sale, just internal. Of course, anyone who can access the website will be able to download that and reuse it.
To avoid others to reuse that library, the first thing to do is obfuscate it, but what about the alternative methods to warn the owner about the inappropriate use of that library?
This JS code is behind a login website, so it's not possible to just use it adding a:
(it will give a 404 error)
So it must be downloaded and installed in a new website. In this case, I think that it's possible to just add a
<img src="http://link.to.owner.site/pixel.jpg" /> that alerts the owner about the inappropriate use of the library (note the use of
http protocol that shows the referer link).
To find and block this kind of warnings, my first idea is to test the library in localhost and check if it is accessing to external URLs (Developer Tools in Google Chrome provide this functionality).
My question is: Is there any similar method to warn the owner about inappropriate uses of the library? How to effectively find this kind of warnings and get rid of them?