Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to automatically get script license and unminified code (if available) #10158

Open
Orisphera opened this issue Feb 23, 2024 · 0 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@Orisphera
Copy link

What problem are you trying to solve?

There are some use cases that require getting the license of a script and/or its unminified version. However, AFAIK there are no ways to do this in the standard.

What solutions exist today?

There's a browser extension that uses several ways to get the license, such as searching for a link marked in a certain way and checking the table it links to. (I don't know if there are any other existing uses, but I can think of some potential ones.) However, many websites don't have the data it looks for.

How would you solve it?

I would add two attributes to the <script> tag. For the first one, I have two options. One is min with a URL to the minified script. If it exists or the body isn't empty, src shouldn't be loaded. This option wouldn't be exactly backwards compatible. The other option is source with a URL to the unminified version. I think the second option is better, but I've decided to leave the first one, too. The other new attribute should be license or a shortened version thereof. It should contain an identifier of the license(s). There should be built-in ones (probably from Nixpkgs), and it should be possible to define custom ones. It should be set up in a way that specifying a license counts as releasing the script under that license. HTML validators should give errors when a script tag is missing license or the license requires source to be present, but it isn't. An example of a script tag with these attributes is <script src="pwa.min.js" source="pwa.js" license="gpl3plus"/>. (It's how it would be for my WIP game, Paul's Weird Adventure. I didn't know about progressive web apps, Paul's Miraculous Adventure, or Pepe and Paul's weird adventure with Meliodas, Zeldris, and Estarossa when choosing the name.)

Anything else?

No response

@Orisphera Orisphera added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

1 participant