Граф коммитов

7 Коммитов

Автор SHA1 Сообщение Дата
dependabot[bot] 0ad915779d
Bump qs from 6.5.2 to 6.5.3
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-09 01:01:53 +00:00
udgathad bd8aa61af5 update package-lock 2022-02-13 15:01:37 -08:00
udgathad 39850fbd1e add reject all button to main banner 2022-02-13 14:46:57 -08:00
BillChou0114 e5e7b25940
Add nonce attribute to style tags and setNonceAttribute(...) method (#27)
* Fix esc key in IE

Instead of `event.key == 'Escape'` in Chrome or Firefox, IE used
`event.key == 'Esc'`.

* `showBanner(...)` only create banner.

In previous version, `showBanner(...)` will create banner and hidden
dialog. In the new version, `showBanner(...) will only create banner.

When user clicks `More info` button, it will call `showPreference(...)`
to create a dialog.

When `onPreferencesDialogShowing()` is called, it will check the dialog
is in the DOM or not. Since the only method to remove the dialog is
`hidePreferencesDialog()`, and it will set
`this.previousFocusElementBeforePopup = null;`, we use
`this.previousFocusElementBeforePopup` to determine the dialog is
in the DOM or not. If there is a dialog, we will not add event listener.

* Add new test cases and update old ones

* Add nonce to style tags and `setNonceAttribute(...)` method

1. Add nonce to all style tags
2. Add `setNonceAttribute(...)` method to set nonce attribute
3. Use `textContent` to replace `innerHTML` to change theme

* Set style nonce in constructor

1. Add stylesNonce in IOptions
2. Add webpack-dev-server configuration for Content Security Policy
3. Set style nonce in constructor

* Update `.d.ts` file and document

1. Add `stylesNonce` in interface `IOptions` and related methods
2. Update `showPreferences(...)`

* Update webpack.production.config.js and bump npm version

* Add explanation in stylesNonce

* Simplify webpack.config.js

Use webpack-merge to simplify webpack configuration file.
webpack.common.js is the common part in developmment and production. Use
webpack.dev.js and webpack.prod.js to insert the development and
production specific configuration.

* Update `nonce` attribute in style tag

Since loaders are stateless, we need to reload it if we want to change
it. Instead, we get the styles contents and remove the blocked style
element with style element id. With the styles contents and passed
`nonce`, we can create the new style element that will not be blocked.

If we removed `style-loader` and loaded style element by ourselves, the
actual styles contents will be `styles[0][1]`.

Reference:
https://webpack.js.org/contribute/writing-a-loader/
https://webpack.js.org/guides/hot-module-replacement/

* Use `style-loader` to `inject` styles and `nonce` to `<style>`

* Only add `nonce` to `<style>` if it is not empty

1. Only add `nonce` to `<style>` when options.stylesNonce is not empty
2. Remove private methods in `.d.ts` file

* Update Jest config and test cases

The new file applied in configuration is based on `identity-obj-proxy`.
styles.locals.bannerBody -> bannerBody

Check:
https://github.com/keyz/identity-obj-proxy/blob/master/src/index.js

* Update test cases

Co-authored-by: Bill Chou (Zen3 Infosolutions America Inc) <v-tincho@microsoft.com>
2020-10-05 14:15:09 -07:00
dependabot[bot] 64244bfdff
Bump elliptic from 6.5.2 to 6.5.3
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-02 05:51:22 +00:00
Max Shmelev d0ce5df11f Create publish workflow 2020-07-27 08:14:24 -07:00
Max Shmelev c9adb26f9c init 2020-04-16 20:26:18 -07:00