File tree Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -66,21 +66,25 @@ export { obj, fn };
66
66
## Compatibility
67
67
| IE| Edge| Firefox| Chrome| Safari| Opera|
68
68
| :-:| :-:| :-:| :-:| :-:| :-:|
69
- | 10<sup >[ 1] [ 2 ] [ 3] </sup >| 12<sup >[ 1] [ 2 ] [ 3] </sup >| 19<sup >[ 1] [ 2 ] [ 3] </sup >| 19<sup >[ 1] [ 2 ] [ 3] </sup >| 6<sup >[ 1] [ 2 ] [ 3] </sup >| 15<sup >[ 1] [ 2 ] [ 3] </sup >|
70
- || 14| 29<sup >[ 1] [ 3 ] </sup >| 32<sup >[ 1] [ 3 ] </sup >| 8<sup >[ 3] </sup >| 19<sup >[ 1] [ 3 ] </sup >|
71
- ||| 41| 49| 10.1| 36|
69
+ | 10<sup >[ 1] [ 2 ] [ 3] </sup >| 12<sup >[ 1] [ 2 ] [ 3] </sup >| 4<sup >[ 1] [ 2 ] [ 3] [ 4 ] </sup >| 13<sup >[ 1] [ 2 ] [ 3] [ 4 ] </sup >| 6<sup >[ 1] [ 2 ] [ 3] </sup >| 12.1<sup >[ 1] [ 2 ] [ 3] [ 4 ] </sup >|
70
+ || 14| 19<sup >[ 1] [ 2 ] [ 3] </sup >| 19<sup >[ 1] [ 2 ] [ 3] </sup >| 8<sup >[ 3] </sup >| 15<sup >[ 1] [ 2 ] [ 3] </sup >|
71
+ ||| 29<sup >[ 1] [ 3 ] </sup >| 32<sup >[ 1] [ 3 ] </sup >| 10.1| 19<sup >[ 1] [ 3 ] </sup >|
72
+ ||| 41| 49|| 36|
72
73
73
74
> Notes:
74
75
> 1 . Don't support destructuring assignment in ESM statement;
75
76
> 1 . Need ` Promise ` polyfill in ShadowRealm;
76
77
> 1 . Need ` fetch ` polyfill in top window;
78
+ > 1 . Need ` URL ` polyfill in top window;
77
79
78
- Use fetch polyfill:
80
+ Use ` fetch ` or ` URL ` polyfill:
79
81
``` js
80
- import " your fetch polyfill" ;
82
+ import " fetch polyfill" ;
83
+ import " URL polyfill" ;
84
+ import " shadowrealm-api/browser/polyfill.mjs" ;
81
85
// Your codes
82
86
```
83
- Use Promise polyfill:
87
+ Use ` Promise ` polyfill:
84
88
``` js
85
89
ShadowRealm .__shims = [
86
90
' path/to/promise-polyfill.js' ,
Original file line number Diff line number Diff line change @@ -67,18 +67,22 @@ export { obj, fn };
67
67
## 兼容性
68
68
| IE| Edge| Firefox| Chrome| Safari| Opera|
69
69
| :-:| :-:| :-:| :-:| :-:| :-:|
70
- | 10<sup >[ 1] [ 2 ] [ 3] </sup >| 12<sup >[ 1] [ 2 ] [ 3] </sup >| 19<sup >[ 1] [ 2 ] [ 3] </sup >| 19<sup >[ 1] [ 2 ] [ 3] </sup >| 6<sup >[ 1] [ 2 ] [ 3] </sup >| 15<sup >[ 1] [ 2 ] [ 3] </sup >|
71
- || 14| 29<sup >[ 1] [ 3 ] </sup >| 32<sup >[ 1] [ 3 ] </sup >| 8<sup >[ 3] </sup >| 19<sup >[ 1] [ 3 ] </sup >|
72
- ||| 41| 49| 10.1| 36|
70
+ | 10<sup >[ 1] [ 2 ] [ 3] </sup >| 12<sup >[ 1] [ 2 ] [ 3] </sup >| 4<sup >[ 1] [ 2 ] [ 3] [ 4 ] </sup >| 13<sup >[ 1] [ 2 ] [ 3] [ 4 ] </sup >| 6<sup >[ 1] [ 2 ] [ 3] </sup >| 12.1<sup >[ 1] [ 2 ] [ 3] [ 4 ] </sup >|
71
+ || 14| 19<sup >[ 1] [ 2 ] [ 3] </sup >| 19<sup >[ 1] [ 2 ] [ 3] </sup >| 8<sup >[ 3] </sup >| 15<sup >[ 1] [ 2 ] [ 3] </sup >|
72
+ ||| 29<sup >[ 1] [ 3 ] </sup >| 32<sup >[ 1] [ 3 ] </sup >| 10.1| 19<sup >[ 1] [ 3 ] </sup >|
73
+ ||| 41| 49|| 36|
73
74
74
75
> Notes:
75
76
> 1 . ESM 语句不支持解构赋值;
76
77
> 1 . ShadowRealm 中需要` Promise ` 垫片;
77
78
> 1 . 顶层作用域需要` fetch ` 垫片;
79
+ > 1 . 顶层作用域需要` URL ` 垫片;
78
80
79
- 使用 fetch 垫片:
81
+ 使用 fetch 或 URL 垫片:
80
82
``` js
81
- import " your fetch polyfill" ;
83
+ import " fetch polyfill" ;
84
+ import " URL polyfill" ;
85
+ import " shadowrealm-api/browser/polyfill.mjs" ;
82
86
// Your codes
83
87
```
84
88
使用 Promise 垫片:
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " shadowrealm-api" ,
3
- "version" : " 0.7.0 " ,
3
+ "version" : " 0.7.1 " ,
4
4
"description" : " ShadowRealm polyfill for browser" ,
5
5
"author" : {
6
6
"name" : " Ambit Tsai" ,
39
39
" realm" ,
40
40
" realms" ,
41
41
" sandbox" ,
42
- " api" ,
43
42
" polyfill" ,
44
43
" ponyfill" ,
45
44
" shim" ,
You can’t perform that action at this time.
0 commit comments