Skip to content

Allow modules and other attributes in script tags when copied #14038

@Explosion-Scratch

Description

@Explosion-Scratch

If someone wants to put a module on CDNJS, then currently when clicking "Copy script tag" it turns out something like this:

<script src="https://cdnjs_url_here"></script>

what if in the json files describing the file, we could also add other attributes, e.g.

//Other JSON stuff here
"filemap": [
  {
      //I forgot how the proper way is to add files to CDNJS that should be tracked, sorry!
      // normal stuff here, like file location and stuff
      "attributes": {
            "type": "module",
            "async": "true",
            "defer": "true",
      }
  }
]
//More JSON stuff

Now clicking "copy script tag" would do this for the file in question:

<script src="https://cdnjs_url_here" async defer type="module"></script>

(oh, and of course only certain attributes would be whitelisted, so that people can't do onerror, or onload)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions