happy-dom 21.0.2 → 21.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/utilities/BrowserFrameNavigator.d.ts.map +1 -1
- package/lib/browser/utilities/BrowserFrameNavigator.js +14 -3
- package/lib/browser/utilities/BrowserFrameNavigator.js.map +1 -1
- package/lib/browser/utilities/BrowserFrameURL.d.ts +22 -0
- package/lib/browser/utilities/BrowserFrameURL.d.ts.map +1 -1
- package/lib/browser/utilities/BrowserFrameURL.js +31 -0
- package/lib/browser/utilities/BrowserFrameURL.js.map +1 -1
- package/lib/cookie/PublicSuffixList.d.ts.map +1 -1
- package/lib/cookie/PublicSuffixList.js +65 -3
- package/lib/cookie/PublicSuffixList.js.map +1 -1
- package/lib/css/declaration/CSSPropertyList.d.ts +18 -2
- package/lib/css/declaration/CSSPropertyList.d.ts.map +1 -1
- package/lib/css/declaration/CSSPropertyList.js +18 -2
- package/lib/css/declaration/CSSPropertyList.js.map +1 -1
- package/lib/css/declaration/ICSSStyleDeclaration.d.ts +18 -2
- package/lib/css/declaration/ICSSStyleDeclaration.d.ts.map +1 -1
- package/lib/fetch/Fetch.d.ts.map +1 -1
- package/lib/fetch/Fetch.js +4 -0
- package/lib/fetch/Fetch.js.map +1 -1
- package/lib/fetch/SyncFetch.d.ts.map +1 -1
- package/lib/fetch/SyncFetch.js +4 -0
- package/lib/fetch/SyncFetch.js.map +1 -1
- package/lib/module/ECMAScriptModuleCompiler.d.ts.map +1 -1
- package/lib/module/ECMAScriptModuleCompiler.js +7 -3
- package/lib/module/ECMAScriptModuleCompiler.js.map +1 -1
- package/lib/nodes/html-iframe-element/HTMLIFrameElement.js +1 -1
- package/lib/nodes/html-iframe-element/HTMLIFrameElement.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/browser/utilities/BrowserFrameNavigator.ts +15 -3
- package/src/browser/utilities/BrowserFrameURL.ts +38 -0
- package/src/cookie/PublicSuffixList.ts +65 -3
- package/src/css/declaration/CSSPropertyList.ts +18 -2
- package/src/css/declaration/ICSSStyleDeclaration.ts +18 -2
- package/src/fetch/Fetch.ts +4 -0
- package/src/fetch/SyncFetch.ts +4 -0
- package/src/module/ECMAScriptModuleCompiler.ts +8 -3
- package/src/nodes/html-iframe-element/HTMLIFrameElement.ts +1 -1
|
@@ -7020,6 +7020,28 @@ export default {
|
|
|
7020
7020
|
'execute-api.us-gov-west-1.amazonaws.com',
|
|
7021
7021
|
'execute-api.us-west-1.amazonaws.com',
|
|
7022
7022
|
'execute-api.us-west-2.amazonaws.com',
|
|
7023
|
+
'consent-portal.bedrock-agentcore.ap-northeast-1.amazonaws.com',
|
|
7024
|
+
'consent-portal.bedrock-agentcore.ap-northeast-2.amazonaws.com',
|
|
7025
|
+
'consent-portal.bedrock-agentcore.ap-south-1.amazonaws.com',
|
|
7026
|
+
'consent-portal.bedrock-agentcore.ap-south-2.amazonaws.com',
|
|
7027
|
+
'consent-portal.bedrock-agentcore.ap-southeast-1.amazonaws.com',
|
|
7028
|
+
'consent-portal.bedrock-agentcore.ap-southeast-2.amazonaws.com',
|
|
7029
|
+
'consent-portal.bedrock-agentcore.ap-southeast-5.amazonaws.com',
|
|
7030
|
+
'consent-portal.bedrock-agentcore.ap-southeast-7.amazonaws.com',
|
|
7031
|
+
'consent-portal.bedrock-agentcore.ca-central-1.amazonaws.com',
|
|
7032
|
+
'consent-portal.bedrock-agentcore.eu-central-1.amazonaws.com',
|
|
7033
|
+
'consent-portal.bedrock-agentcore.eu-north-1.amazonaws.com',
|
|
7034
|
+
'consent-portal.bedrock-agentcore.eu-south-1.amazonaws.com',
|
|
7035
|
+
'consent-portal.bedrock-agentcore.eu-south-2.amazonaws.com',
|
|
7036
|
+
'consent-portal.bedrock-agentcore.eu-west-1.amazonaws.com',
|
|
7037
|
+
'consent-portal.bedrock-agentcore.eu-west-2.amazonaws.com',
|
|
7038
|
+
'consent-portal.bedrock-agentcore.eu-west-3.amazonaws.com',
|
|
7039
|
+
'consent-portal.bedrock-agentcore.sa-east-1.amazonaws.com',
|
|
7040
|
+
'consent-portal.bedrock-agentcore.us-east-1.amazonaws.com',
|
|
7041
|
+
'consent-portal.bedrock-agentcore.us-east-2.amazonaws.com',
|
|
7042
|
+
'consent-portal.bedrock-agentcore.us-gov-west-1.amazonaws.com',
|
|
7043
|
+
'consent-portal.bedrock-agentcore.us-west-1.amazonaws.com',
|
|
7044
|
+
'consent-portal.bedrock-agentcore.us-west-2.amazonaws.com',
|
|
7023
7045
|
'cloudfront.net',
|
|
7024
7046
|
'auth.af-south-1.amazoncognito.com',
|
|
7025
7047
|
'auth.ap-east-1.amazoncognito.com',
|
|
@@ -7693,6 +7715,7 @@ export default {
|
|
|
7693
7715
|
'lambda-url.us-west-2.on.aws',
|
|
7694
7716
|
'transfer-webapp.af-south-1.on.aws',
|
|
7695
7717
|
'transfer-webapp.ap-east-1.on.aws',
|
|
7718
|
+
'transfer-webapp.ap-east-2.on.aws',
|
|
7696
7719
|
'transfer-webapp.ap-northeast-1.on.aws',
|
|
7697
7720
|
'transfer-webapp.ap-northeast-2.on.aws',
|
|
7698
7721
|
'transfer-webapp.ap-northeast-3.on.aws',
|
|
@@ -7703,6 +7726,7 @@ export default {
|
|
|
7703
7726
|
'transfer-webapp.ap-southeast-3.on.aws',
|
|
7704
7727
|
'transfer-webapp.ap-southeast-4.on.aws',
|
|
7705
7728
|
'transfer-webapp.ap-southeast-5.on.aws',
|
|
7729
|
+
'transfer-webapp.ap-southeast-6.on.aws',
|
|
7706
7730
|
'transfer-webapp.ap-southeast-7.on.aws',
|
|
7707
7731
|
'transfer-webapp.ca-central-1.on.aws',
|
|
7708
7732
|
'transfer-webapp.ca-west-1.on.aws',
|
|
@@ -7729,6 +7753,7 @@ export default {
|
|
|
7729
7753
|
'transfer-webapp.us-west-2.on.aws',
|
|
7730
7754
|
'transfer-webapp.cn-north-1.on.amazonwebservices.com.cn',
|
|
7731
7755
|
'transfer-webapp.cn-northwest-1.on.amazonwebservices.com.cn',
|
|
7756
|
+
'transfer-webapp.eusc-de-east-1.on.amazonwebservices.eu',
|
|
7732
7757
|
'eero.online',
|
|
7733
7758
|
'eero-stage.online',
|
|
7734
7759
|
'opentunnel.xyz',
|
|
@@ -8624,7 +8649,6 @@ export default {
|
|
|
8624
8649
|
'githubpreview.dev',
|
|
8625
8650
|
'github.io',
|
|
8626
8651
|
'gitlab.io',
|
|
8627
|
-
'gitapp.si',
|
|
8628
8652
|
'gitpage.si',
|
|
8629
8653
|
'glideos.app',
|
|
8630
8654
|
'nog.community',
|
|
@@ -9001,7 +9025,6 @@ export default {
|
|
|
9001
9025
|
'kiloapps.io',
|
|
9002
9026
|
'kinghost.net',
|
|
9003
9027
|
'uni5.net',
|
|
9004
|
-
'knightpoint.systems',
|
|
9005
9028
|
'koobin.events',
|
|
9006
9029
|
'webthings.io',
|
|
9007
9030
|
'krellian.net',
|
|
@@ -9266,6 +9289,45 @@ export default {
|
|
|
9266
9289
|
'yali.mythic-beasts.com',
|
|
9267
9290
|
'cust.retrosnub.co.uk',
|
|
9268
9291
|
'ui.nabu.casa',
|
|
9292
|
+
'kr.object.fin-ncloudstorage.com',
|
|
9293
|
+
's3-website.kr.object.fin-ncloudstorage.com',
|
|
9294
|
+
'kr.object.private.fin-ncloudstorage.com',
|
|
9295
|
+
'kr.gov-ncloudstorage.com',
|
|
9296
|
+
'kr-private.gov-ncloudstorage.com',
|
|
9297
|
+
'kr.object.gov-ncloudstorage.com',
|
|
9298
|
+
's3-website.kr.object.gov-ncloudstorage.com',
|
|
9299
|
+
'krs.object.gov-ncloudstorage.com',
|
|
9300
|
+
's3-website.krs.object.gov-ncloudstorage.com',
|
|
9301
|
+
'kr.object.private.gov-ncloudstorage.com',
|
|
9302
|
+
'krs.object.private.gov-ncloudstorage.com',
|
|
9303
|
+
'kr.objectstorage.ncloud.com',
|
|
9304
|
+
'sg.objectstorage.ncloud.com',
|
|
9305
|
+
'kr.ncloudstorage.com',
|
|
9306
|
+
'kr-naver.ncloudstorage.com',
|
|
9307
|
+
'kr-naver-dev.ncloudstorage.com',
|
|
9308
|
+
'kr-private.ncloudstorage.com',
|
|
9309
|
+
'de.object.ncloudstorage.com',
|
|
9310
|
+
's3-website.de.object.ncloudstorage.com',
|
|
9311
|
+
'kr.object.ncloudstorage.com',
|
|
9312
|
+
's3-website.kr.object.ncloudstorage.com',
|
|
9313
|
+
'sg.object.ncloudstorage.com',
|
|
9314
|
+
's3-website.sg.object.ncloudstorage.com',
|
|
9315
|
+
'us.object.ncloudstorage.com',
|
|
9316
|
+
's3-website.us.object.ncloudstorage.com',
|
|
9317
|
+
'kr.object.private.ncloudstorage.com',
|
|
9318
|
+
'sg.object.private.ncloudstorage.com',
|
|
9319
|
+
'kr.website.ncloudstorage.com',
|
|
9320
|
+
'kr-naver.website.ncloudstorage.com',
|
|
9321
|
+
'kr-naver-dev.website.ncloudstorage.com',
|
|
9322
|
+
'jp.object.ncpstorage.com',
|
|
9323
|
+
'jp.jp4.object.ncpstorage.com',
|
|
9324
|
+
'jp.jp5.object.ncpstorage.com',
|
|
9325
|
+
'kr.object.ncpstorage.com',
|
|
9326
|
+
's3-website-jp.object.ncpstorage.com',
|
|
9327
|
+
'jp.object.private.ncpstorage.com',
|
|
9328
|
+
'jp.jp4.object.private.ncpstorage.com',
|
|
9329
|
+
'jp.jp5.object.private.ncpstorage.com',
|
|
9330
|
+
'kr.object.private.ncpstorage.com',
|
|
9269
9331
|
'needle.run',
|
|
9270
9332
|
'co.site',
|
|
9271
9333
|
'cloud.nospamproxy.com',
|
|
@@ -9484,7 +9546,6 @@ export default {
|
|
|
9484
9546
|
'gl.srv.us',
|
|
9485
9547
|
'mypep.link',
|
|
9486
9548
|
'pplx.app',
|
|
9487
|
-
'perspecta.cloud',
|
|
9488
9549
|
'forgeblocks.com',
|
|
9489
9550
|
'id.forgerock.io',
|
|
9490
9551
|
'support.site',
|
|
@@ -10081,6 +10142,7 @@ export default {
|
|
|
10081
10142
|
'airflow.ap-southeast-3.on.aws',
|
|
10082
10143
|
'airflow.ap-southeast-4.on.aws',
|
|
10083
10144
|
'airflow.ap-southeast-5.on.aws',
|
|
10145
|
+
'airflow.ap-southeast-7.on.aws',
|
|
10084
10146
|
'airflow.ca-central-1.on.aws',
|
|
10085
10147
|
'airflow.ca-west-1.on.aws',
|
|
10086
10148
|
'airflow.eu-central-1.on.aws',
|
|
@@ -149,6 +149,7 @@ export default {
|
|
|
149
149
|
'fill-opacity': 'fillOpacity',
|
|
150
150
|
'fill-rule': 'fillRule',
|
|
151
151
|
filter: 'filter',
|
|
152
|
+
'fit-tolerance': 'fitTolerance',
|
|
152
153
|
'flex-basis': 'flexBasis',
|
|
153
154
|
'flex-direction': 'flexDirection',
|
|
154
155
|
'flex-grow': 'flexGrow',
|
|
@@ -158,7 +159,6 @@ export default {
|
|
|
158
159
|
float: 'float',
|
|
159
160
|
'flood-color': 'floodColor',
|
|
160
161
|
'flood-opacity': 'floodOpacity',
|
|
161
|
-
'flow-tolerance': 'flowTolerance',
|
|
162
162
|
'frame-sizing': 'frameSizing',
|
|
163
163
|
'grid-auto-columns': 'gridAutoColumns',
|
|
164
164
|
'grid-auto-flow': 'gridAutoFlow',
|
|
@@ -507,24 +507,32 @@ export default {
|
|
|
507
507
|
border: 'border',
|
|
508
508
|
'border-block': 'borderBlock',
|
|
509
509
|
'border-block-color': 'borderBlockColor',
|
|
510
|
+
'border-block-end-radius': 'borderBlockEndRadius',
|
|
510
511
|
'border-block-end': 'borderBlockEnd',
|
|
512
|
+
'border-block-start-radius': 'borderBlockStartRadius',
|
|
511
513
|
'border-block-start': 'borderBlockStart',
|
|
512
514
|
'border-block-style': 'borderBlockStyle',
|
|
513
515
|
'border-block-width': 'borderBlockWidth',
|
|
516
|
+
'border-bottom-radius': 'borderBottomRadius',
|
|
514
517
|
'border-bottom': 'borderBottom',
|
|
515
518
|
'border-color': 'borderColor',
|
|
516
519
|
'border-image': 'borderImage',
|
|
517
520
|
'border-inline': 'borderInline',
|
|
518
521
|
'border-inline-color': 'borderInlineColor',
|
|
522
|
+
'border-inline-end-radius': 'borderInlineEndRadius',
|
|
519
523
|
'border-inline-end': 'borderInlineEnd',
|
|
524
|
+
'border-inline-start-radius': 'borderInlineStartRadius',
|
|
520
525
|
'border-inline-start': 'borderInlineStart',
|
|
521
526
|
'border-inline-style': 'borderInlineStyle',
|
|
522
527
|
'border-inline-width': 'borderInlineWidth',
|
|
528
|
+
'border-left-radius': 'borderLeftRadius',
|
|
523
529
|
'border-left': 'borderLeft',
|
|
524
530
|
'border-radius': 'borderRadius',
|
|
531
|
+
'border-right-radius': 'borderRightRadius',
|
|
525
532
|
'border-right': 'borderRight',
|
|
526
533
|
'border-spacing': 'borderSpacing',
|
|
527
534
|
'border-style': 'borderStyle',
|
|
535
|
+
'border-top-radius': 'borderTopRadius',
|
|
528
536
|
'border-top': 'borderTop',
|
|
529
537
|
'border-width': 'borderWidth',
|
|
530
538
|
'column-rule-inset-cap': 'columnRuleInsetCap',
|
|
@@ -784,6 +792,7 @@ export default {
|
|
|
784
792
|
fillOpacity: 'fill-opacity',
|
|
785
793
|
fillRule: 'fill-rule',
|
|
786
794
|
filter: 'filter',
|
|
795
|
+
fitTolerance: 'fit-tolerance',
|
|
787
796
|
flexBasis: 'flex-basis',
|
|
788
797
|
flexDirection: 'flex-direction',
|
|
789
798
|
flexGrow: 'flex-grow',
|
|
@@ -793,7 +802,6 @@ export default {
|
|
|
793
802
|
float: 'float',
|
|
794
803
|
floodColor: 'flood-color',
|
|
795
804
|
floodOpacity: 'flood-opacity',
|
|
796
|
-
flowTolerance: 'flow-tolerance',
|
|
797
805
|
frameSizing: 'frame-sizing',
|
|
798
806
|
gridAutoColumns: 'grid-auto-columns',
|
|
799
807
|
gridAutoFlow: 'grid-auto-flow',
|
|
@@ -1142,24 +1150,32 @@ export default {
|
|
|
1142
1150
|
border: 'border',
|
|
1143
1151
|
borderBlock: 'border-block',
|
|
1144
1152
|
borderBlockColor: 'border-block-color',
|
|
1153
|
+
borderBlockEndRadius: 'border-block-end-radius',
|
|
1145
1154
|
borderBlockEnd: 'border-block-end',
|
|
1155
|
+
borderBlockStartRadius: 'border-block-start-radius',
|
|
1146
1156
|
borderBlockStart: 'border-block-start',
|
|
1147
1157
|
borderBlockStyle: 'border-block-style',
|
|
1148
1158
|
borderBlockWidth: 'border-block-width',
|
|
1159
|
+
borderBottomRadius: 'border-bottom-radius',
|
|
1149
1160
|
borderBottom: 'border-bottom',
|
|
1150
1161
|
borderColor: 'border-color',
|
|
1151
1162
|
borderImage: 'border-image',
|
|
1152
1163
|
borderInline: 'border-inline',
|
|
1153
1164
|
borderInlineColor: 'border-inline-color',
|
|
1165
|
+
borderInlineEndRadius: 'border-inline-end-radius',
|
|
1154
1166
|
borderInlineEnd: 'border-inline-end',
|
|
1167
|
+
borderInlineStartRadius: 'border-inline-start-radius',
|
|
1155
1168
|
borderInlineStart: 'border-inline-start',
|
|
1156
1169
|
borderInlineStyle: 'border-inline-style',
|
|
1157
1170
|
borderInlineWidth: 'border-inline-width',
|
|
1171
|
+
borderLeftRadius: 'border-left-radius',
|
|
1158
1172
|
borderLeft: 'border-left',
|
|
1159
1173
|
borderRadius: 'border-radius',
|
|
1174
|
+
borderRightRadius: 'border-right-radius',
|
|
1160
1175
|
borderRight: 'border-right',
|
|
1161
1176
|
borderSpacing: 'border-spacing',
|
|
1162
1177
|
borderStyle: 'border-style',
|
|
1178
|
+
borderTopRadius: 'border-top-radius',
|
|
1163
1179
|
borderTop: 'border-top',
|
|
1164
1180
|
borderWidth: 'border-width',
|
|
1165
1181
|
columnRuleInsetCap: 'column-rule-inset-cap',
|
|
@@ -279,6 +279,8 @@ export default interface ICSSStyleDeclaration {
|
|
|
279
279
|
fillRule: string;
|
|
280
280
|
'fill-rule': string;
|
|
281
281
|
filter: string;
|
|
282
|
+
fitTolerance: string;
|
|
283
|
+
'fit-tolerance': string;
|
|
282
284
|
flexBasis: string;
|
|
283
285
|
'flex-basis': string;
|
|
284
286
|
flexDirection: string;
|
|
@@ -296,8 +298,6 @@ export default interface ICSSStyleDeclaration {
|
|
|
296
298
|
'flood-color': string;
|
|
297
299
|
floodOpacity: string;
|
|
298
300
|
'flood-opacity': string;
|
|
299
|
-
flowTolerance: string;
|
|
300
|
-
'flow-tolerance': string;
|
|
301
301
|
frameSizing: string;
|
|
302
302
|
'frame-sizing': string;
|
|
303
303
|
gridAutoColumns: string;
|
|
@@ -936,14 +936,20 @@ export default interface ICSSStyleDeclaration {
|
|
|
936
936
|
'border-block': string;
|
|
937
937
|
borderBlockColor: string;
|
|
938
938
|
'border-block-color': string;
|
|
939
|
+
borderBlockEndRadius: string;
|
|
940
|
+
'border-block-end-radius': string;
|
|
939
941
|
borderBlockEnd: string;
|
|
940
942
|
'border-block-end': string;
|
|
943
|
+
borderBlockStartRadius: string;
|
|
944
|
+
'border-block-start-radius': string;
|
|
941
945
|
borderBlockStart: string;
|
|
942
946
|
'border-block-start': string;
|
|
943
947
|
borderBlockStyle: string;
|
|
944
948
|
'border-block-style': string;
|
|
945
949
|
borderBlockWidth: string;
|
|
946
950
|
'border-block-width': string;
|
|
951
|
+
borderBottomRadius: string;
|
|
952
|
+
'border-bottom-radius': string;
|
|
947
953
|
borderBottom: string;
|
|
948
954
|
'border-bottom': string;
|
|
949
955
|
borderColor: string;
|
|
@@ -954,24 +960,34 @@ export default interface ICSSStyleDeclaration {
|
|
|
954
960
|
'border-inline': string;
|
|
955
961
|
borderInlineColor: string;
|
|
956
962
|
'border-inline-color': string;
|
|
963
|
+
borderInlineEndRadius: string;
|
|
964
|
+
'border-inline-end-radius': string;
|
|
957
965
|
borderInlineEnd: string;
|
|
958
966
|
'border-inline-end': string;
|
|
967
|
+
borderInlineStartRadius: string;
|
|
968
|
+
'border-inline-start-radius': string;
|
|
959
969
|
borderInlineStart: string;
|
|
960
970
|
'border-inline-start': string;
|
|
961
971
|
borderInlineStyle: string;
|
|
962
972
|
'border-inline-style': string;
|
|
963
973
|
borderInlineWidth: string;
|
|
964
974
|
'border-inline-width': string;
|
|
975
|
+
borderLeftRadius: string;
|
|
976
|
+
'border-left-radius': string;
|
|
965
977
|
borderLeft: string;
|
|
966
978
|
'border-left': string;
|
|
967
979
|
borderRadius: string;
|
|
968
980
|
'border-radius': string;
|
|
981
|
+
borderRightRadius: string;
|
|
982
|
+
'border-right-radius': string;
|
|
969
983
|
borderRight: string;
|
|
970
984
|
'border-right': string;
|
|
971
985
|
borderSpacing: string;
|
|
972
986
|
'border-spacing': string;
|
|
973
987
|
borderStyle: string;
|
|
974
988
|
'border-style': string;
|
|
989
|
+
borderTopRadius: string;
|
|
990
|
+
'border-top-radius': string;
|
|
975
991
|
borderTop: string;
|
|
976
992
|
'border-top': string;
|
|
977
993
|
borderWidth: string;
|
package/src/fetch/Fetch.ts
CHANGED
|
@@ -960,6 +960,10 @@ export default class Fetch {
|
|
|
960
960
|
}
|
|
961
961
|
|
|
962
962
|
const headers = new this.#window.Headers(this.request.headers);
|
|
963
|
+
// Fetch requires stripping Authorization on cross-origin redirects in every credentials mode.
|
|
964
|
+
if (FetchCORSUtility.isCORS(this.request.url, locationURL)) {
|
|
965
|
+
headers.delete('authorization');
|
|
966
|
+
}
|
|
963
967
|
const requestInit: IRequestInit = {
|
|
964
968
|
method: this.request.method,
|
|
965
969
|
signal: this.request.signal,
|
package/src/fetch/SyncFetch.ts
CHANGED
|
@@ -666,6 +666,10 @@ export default class SyncFetch {
|
|
|
666
666
|
}
|
|
667
667
|
|
|
668
668
|
const headers = new this.#window.Headers(this.request.headers);
|
|
669
|
+
// Fetch requires stripping Authorization on cross-origin redirects in every credentials mode.
|
|
670
|
+
if (FetchCORSUtility.isCORS(this.request.url, locationURL)) {
|
|
671
|
+
headers.delete('authorization');
|
|
672
|
+
}
|
|
669
673
|
const requestInit: IRequestInit = {
|
|
670
674
|
method: this.request.method,
|
|
671
675
|
signal: this.request.signal,
|
|
@@ -61,6 +61,11 @@ const IMPORT_REGEXP = /{([^}]+)}|\*\s+as\s+([a-zA-Z0-9-_$]+)|([a-zA-Z0-9-_$]+)/g
|
|
|
61
61
|
*/
|
|
62
62
|
const VALID_VARIABLE_NAME_REGEXP = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Valid local binding identifier regexp (supports Unicode identifiers).
|
|
66
|
+
*/
|
|
67
|
+
const VALID_BINDING_NAME_REGEXP = /^[\p{ID_Start}_$][\p{ID_Continue}$\u200c\u200d]*$/u;
|
|
68
|
+
|
|
64
69
|
/**
|
|
65
70
|
* Valid preceding token before a statement.
|
|
66
71
|
*/
|
|
@@ -274,8 +279,8 @@ export default class ECMAScriptModuleCompiler {
|
|
|
274
279
|
for (const part of parts) {
|
|
275
280
|
const nameParts = part.trim().split(/\s+as\s+/);
|
|
276
281
|
const alias = (nameParts[1] || nameParts[0]).replace(/["']/g, '');
|
|
277
|
-
const name = nameParts[0].replace(/["']/g, '');
|
|
278
|
-
if (alias && name) {
|
|
282
|
+
const name = nameParts[0].replace(/["'\\\r\n\u2028\u2029]/g, '');
|
|
283
|
+
if (alias && name && VALID_BINDING_NAME_REGEXP.test(alias)) {
|
|
279
284
|
if (name === alias) {
|
|
280
285
|
properties.push({ name });
|
|
281
286
|
} else {
|
|
@@ -286,7 +291,7 @@ export default class ECMAScriptModuleCompiler {
|
|
|
286
291
|
if (!match[7] || match[7] === 'esm') {
|
|
287
292
|
resolvableCircularImports.push({ url, properties });
|
|
288
293
|
}
|
|
289
|
-
newCodeStart += `let {${properties.map((property) => (property.alias ?
|
|
294
|
+
newCodeStart += `let {${properties.map((property) => (property.alias ? `${JSON.stringify(property.name)}: ${property.alias}` : property.name)).join(', ')}} = $happy_dom.imports.get('${url}')${match[8]}`;
|
|
290
295
|
} else if (importMatch[2]) {
|
|
291
296
|
// Import all as
|
|
292
297
|
newCodeStart += `const ${importMatch[2]} = $happy_dom.imports.get('${url}')${match[8]}`;
|
|
@@ -425,7 +425,7 @@ export default class HTMLIFrameElement extends HTMLElement {
|
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
// Iframes has a special rule for CORS and doesn't allow access between frames when the origin is different.
|
|
428
|
-
const isSameOrigin = originURL
|
|
428
|
+
const isSameOrigin = BrowserFrameURL.isSameOrigin(originURL, targetURL);
|
|
429
429
|
const parentWindow = isSameOrigin ? window : new CrossOriginBrowserWindow(window);
|
|
430
430
|
|
|
431
431
|
this.#iframe = this.#iframe ?? BrowserFrameFactory.createChildFrame(browserFrame);
|