wicg-inert 3.0.1 → 3.1.1
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/README.md +29 -0
- package/dist/inert.esm.js +832 -0
- package/dist/inert.js +682 -675
- package/dist/inert.min.js +1 -1
- package/dist/inert.min.js.map +1 -1
- package/package.json +2 -2
- package/rollup.config.js +12 -0
- package/src/inert.js +627 -620
- package/w3c.json +1 -1
package/README.md
CHANGED
@@ -82,6 +82,35 @@ following line to the start of your page:
|
|
82
82
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Map,Set,Element.prototype.matches,Node.prototype.contains"></script>
|
83
83
|
```
|
84
84
|
|
85
|
+
### Strict Content Security Policy
|
86
|
+
|
87
|
+
By default, this polyfill will dynamically insert some CSS, which requires the
|
88
|
+
style-src rule of your Content Security Policy to allow 'unsafe-inline'.
|
89
|
+
|
90
|
+
It is possible avoid doing so by including those rules from a CSS stylesheet, as
|
91
|
+
follows (the `id` property is used by the polyfill to know if it needs to
|
92
|
+
dynamically add the missing rules):
|
93
|
+
|
94
|
+
```html
|
95
|
+
<link rel="stylesheet" type="text/css" href="inert.css" id="inert-style" />
|
96
|
+
```
|
97
|
+
|
98
|
+
The stylesheet should include the following rules:
|
99
|
+
|
100
|
+
```css
|
101
|
+
[inert] {
|
102
|
+
pointer-events: none;
|
103
|
+
cursor: default;
|
104
|
+
}
|
105
|
+
|
106
|
+
[inert], [inert] * {
|
107
|
+
user-select: none;
|
108
|
+
-webkit-user-select: none;
|
109
|
+
-moz-user-select: none;
|
110
|
+
-ms-user-select: none;
|
111
|
+
}
|
112
|
+
```
|
113
|
+
|
85
114
|
### Performance and gotchas
|
86
115
|
|
87
116
|
The polyfill attempts to provide a reasonable fidelity polyfill for the `inert`
|