In the past, I have talked about the concept of using JavaScript sourcemaps for minified JS code as a way to check the source for the JavaScript where the author could put in the licensing information. The sourcemap is referenced in the minified code and some browsers have the option to view the linked source in their developer tools. There you can throw in your full license headers at the start of your file and do it properly.

You could say that the majority of websites will not provide the raw source code if they don't have to. If they did though, I believe the sourcemap solution is the most direct. There have been solutions in the past (like RMS's JavaScript trap) that want users to include @license tags, but hasn't been used much nor is it standardized.

If I had the time, I would build a better solution than LibreJS or "JavaScript Must Die" and do an extension that would be reliant on the sourcemaps and pull license information from that. Its still a daydream though as no one even uses sourcemaps. :-(

Reply via email to