Skip to content

Commit bd85604

Browse files
authored
New: Add crossorigin attribute (#100)
1 parent 04e6659 commit bd85604

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

js/src/test/scala/com/thirdparty/defs/props/Props.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,4 +713,19 @@ trait Props {
713713
lazy val xmlns: Prop[String, String] = stringProp("xmlns")
714714

715715

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

shared/src/main/scala/com/raquo/domtypes/defs/reflectedAttrs/ReflectedHtmlAttrDefs.scala

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,29 @@ object ReflectedHtmlAttrDefs {
11051105
docUrls = Nil,
11061106
),
11071107

1108+
ReflectedHtmlAttrDef(
1109+
scalaName = "crossOrigin",
1110+
domAttrName = "crossorigin",
1111+
domPropName = "crossOrigin",
1112+
scalaValueType = "String",
1113+
domPropValueType = "String",
1114+
attrCodec = "StringAsIs",
1115+
propCodec = "StringAsIs",
1116+
commentLines = List(
1117+
"This attribute specifies how the browser should handle cross-origin",
1118+
"requests for the associated resource. It controls whether the resource can",
1119+
"be loaded when requested from a different domain, and how to handle potential",
1120+
"security issues, like CORS (Cross-Origin Resource Sharing) policies.",
1121+
"The value of this attribute determines whether the browser will allow or",
1122+
"block loading of the resource, helping to enhance web security.",
1123+
"",
1124+
"""Allowed values: "anonymous" | "use-credentials" | "" (same as "anonymous") """
1125+
),
1126+
docUrls = List(
1127+
"https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin"
1128+
),
1129+
),
1130+
11081131
)
11091132

11101133
}

0 commit comments

Comments
 (0)