|
21 | 21 |
|
22 | 22 | • **active**? : *undefined | false | true*
|
23 | 23 |
|
24 |
| -*Defined in [index.ts:41](https://github.com/JonasKruckenberg/rollup-plugin-sri/blob/a8b2ca2/index.ts#L41)* |
| 24 | +*Defined in [index.ts:43](https://github.com/JonasKruckenberg/rollup-plugin-sri/blob/4f07722/index.ts#L43)* |
25 | 25 |
|
26 | 26 | Can be used to disable the plugin, for example when used together with hot-module-reloading.
|
27 | 27 |
|
|
33 | 33 |
|
34 | 34 | • **algorithms**? : *string[]*
|
35 | 35 |
|
36 |
| -*Defined in [index.ts:27](https://github.com/JonasKruckenberg/rollup-plugin-sri/blob/a8b2ca2/index.ts#L27)* |
| 36 | +*Defined in [index.ts:29](https://github.com/JonasKruckenberg/rollup-plugin-sri/blob/4f07722/index.ts#L29)* |
37 | 37 |
|
38 | 38 | A list of hashing algorithms to use when computing the integrity attribute.
|
39 |
| -The hashing algorithm has to be supported by the nodejs version you're running on. |
40 |
| -Standard hash functions are: `sha256`, `sha384` and `sha512`. |
| 39 | +The hashing algorithm has to be supported by the nodejs version you're running on and by the Browser you're targeting. |
| 40 | +Browsers will ignore unknown hashing functions. |
| 41 | +Standard hash functions as defined in the [subresource integrity specification](https://w3c.github.io/webappsec-subresource-integrity/#hash-functions) are: `sha256`, `sha384` and `sha512`. |
| 42 | + |
41 | 43 | > NOTE: While browser vendors are free to support more algorithms than those stated above,
|
42 | 44 | > they generally do not accept `sha1` and `md5` hashes.
|
43 | 45 |
|
|
49 | 51 |
|
50 | 52 | • **crossorigin**? : *"anonymous" | "use-credentials"*
|
51 | 53 |
|
52 |
| -*Defined in [index.ts:35](https://github.com/JonasKruckenberg/rollup-plugin-sri/blob/a8b2ca2/index.ts#L35)* |
| 54 | +*Defined in [index.ts:37](https://github.com/JonasKruckenberg/rollup-plugin-sri/blob/4f07722/index.ts#L37)* |
53 | 55 |
|
54 |
| -You can also specify the value for the crossorigin attribute. |
55 |
| -This attribute has to be set to prevent cross-origin data leakage. |
| 56 | +Specifies the value for the crossorigin attribute. |
| 57 | +This attribute has to be set on the generated html tags to prevent cross-origin data leakage. |
56 | 58 | The default value `anonymous` should be okay for normal use.
|
57 | 59 | see: [the W3C spec](https://www.w3.org/TR/SRI/#cross-origin-data-leakage) for details.
|
58 | 60 |
|
|
64 | 66 |
|
65 | 67 | • **selectors**? : *string[]*
|
66 | 68 |
|
67 |
| -*Defined in [index.ts:18](https://github.com/JonasKruckenberg/rollup-plugin-sri/blob/a8b2ca2/index.ts#L18)* |
| 69 | +*Defined in [index.ts:18](https://github.com/JonasKruckenberg/rollup-plugin-sri/blob/4f07722/index.ts#L18)* |
68 | 70 |
|
69 |
| -A list of strings you can provide that the plugin will use to match. |
70 |
| -it will then try to compute an integrity attribute for the matched tag. |
| 71 | +A list of strings you can provide that the plugin will use to match html tags with. |
| 72 | +It will then try to compute an integrity attribute for the matched tag. |
71 | 73 | Currently it only matches script tags and link with rel=stylesheet as per specification.
|
72 | 74 | see [the W3C spec](https://www.w3.org/TR/SRI/#elements) for more information.
|
73 | 75 | The selector syntax is the same as jQuery's.
|
|
0 commit comments