Skip to content

Commit

Permalink
New: Add crossorigin attribute (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyz1901 committed Nov 7, 2023
1 parent 04e6659 commit bd85604
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
15 changes: 15 additions & 0 deletions js/src/test/scala/com/thirdparty/defs/props/Props.scala
Original file line number Diff line number Diff line change
Expand Up @@ -713,4 +713,19 @@ trait Props {
lazy val xmlns: Prop[String, String] = stringProp("xmlns")


/**
* This attribute specifies how the browser should handle cross-origin
* requests for the associated resource. It controls whether the resource can
* be loaded when requested from a different domain, and how to handle potential
* security issues, like CORS (Cross-Origin Resource Sharing) policies.
* The value of this attribute determines whether the browser will allow or
* block loading of the resource, helping to enhance web security.
*
* Allowed values: "anonymous" | "use-credentials" | "" (same as "anonymous")
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin
*/
lazy val crossOrigin: Prop[String, String] = stringProp("crossOrigin")


}
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,29 @@ object ReflectedHtmlAttrDefs {
docUrls = Nil,
),

ReflectedHtmlAttrDef(
scalaName = "crossOrigin",
domAttrName = "crossorigin",
domPropName = "crossOrigin",
scalaValueType = "String",
domPropValueType = "String",
attrCodec = "StringAsIs",
propCodec = "StringAsIs",
commentLines = List(
"This attribute specifies how the browser should handle cross-origin",
"requests for the associated resource. It controls whether the resource can",
"be loaded when requested from a different domain, and how to handle potential",
"security issues, like CORS (Cross-Origin Resource Sharing) policies.",
"The value of this attribute determines whether the browser will allow or",
"block loading of the resource, helping to enhance web security.",
"",
"""Allowed values: "anonymous" | "use-credentials" | "" (same as "anonymous") """
),
docUrls = List(
"https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin"
),
),

)

}

0 comments on commit bd85604

Please sign in to comment.