chefcookie 2.8.2 → 2.8.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/CHANGELOG.md CHANGED
@@ -4,7 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- #### [2.8.1](https://github.com/vielhuber/chefcookie/compare/2.8.1...2.8.1)
7
+ #### [2.8.3](https://github.com/vielhuber/chefcookie/compare/2.8.3...2.8.3)
8
+
9
+ #### [2.8.3](https://github.com/vielhuber/chefcookie/compare/2.8.2...2.8.3)
10
+
11
+ > 10 September 2023
12
+
13
+ - Update changelog. [`66a293a`](https://github.com/vielhuber/chefcookie/commit/66a293a92690f18978a1738a0711fdf87a5486fc)
14
+ - Improve readme. [`1c04bf1`](https://github.com/vielhuber/chefcookie/commit/1c04bf15b011ef7759927d5ae20ba9b0f8c168ed)
15
+
16
+ #### [2.8.2](https://github.com/vielhuber/chefcookie/compare/2.8.1...2.8.2)
17
+
18
+ > 24 July 2023
19
+
20
+ - Improve exclusion rules. [`2b063b7`](https://github.com/vielhuber/chefcookie/commit/2b063b78890a3adcc415dce45d9a71ade7361946)
21
+ - Update changelog. [`08d1dbd`](https://github.com/vielhuber/chefcookie/commit/08d1dbd252669535338e4756d5788c9470aba197)
8
22
 
9
23
  #### [2.8.1](https://github.com/vielhuber/chefcookie/compare/2.8.0...2.8.1)
10
24
 
package/README.md CHANGED
@@ -80,6 +80,7 @@ const cc = new chefcookie({
80
80
  show_decline_button: false,
81
81
  scripts_selection: 'collapse', // false|true|'collapse'
82
82
  debug_log: false,
83
+ bypass_parameter: null, // e.g. {'ignore': '1', 'foo': 'bar'}
83
84
  consent_tracking: null, // '/wp-json/v1/track-consent.php'
84
85
  lng_fallback: null, // lng code used in labels when current lng is not found (e.g. "en")
85
86
  expiration: 7, // in days
@@ -352,9 +353,11 @@ cc.decline('analytics');
352
353
  cc.isAccepted('analytics'); // true|false
353
354
  ```
354
355
 
355
- #### backdoor
356
+ #### bypass / backdoor
356
357
 
357
- just add `?accept=1` to your urls to completely bypass chefcookie.
358
+ add `?accept=1` to your urls to completely bypass chefcookie and\
359
+ ignore user consent which means all scripts are in fact accepted.\
360
+ you also can define custom parameter name/value pairs via `bypass_parameter`.
358
361
 
359
362
  #### custom scripts
360
363
 
package/_build/script.js CHANGED
@@ -221,6 +221,16 @@ var chefcookie = /*#__PURE__*/function () {
221
221
  }, {
222
222
  key: "forceAccept",
223
223
  value: function forceAccept() {
224
+ if ('bypass_parameter' in this.config && this.config.bypass_parameter !== false && this.config.bypass_parameter !== undefined && this.config.bypass_parameter !== null && this.config.bypass_parameter !== '' && (0, _typeof2.default)(this.config.bypass_parameter) === 'object' && !Array.isArray(this.config.bypass_parameter)) {
225
+ for (var _i = 0, _Object$entries = Object.entries(this.config.bypass_parameter); _i < _Object$entries.length; _i++) {
226
+ var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
227
+ bypass_parameter__key = _Object$entries$_i[0],
228
+ bypass_parameter__value = _Object$entries$_i[1];
229
+ if (_helper.default.getParam(bypass_parameter__key) == bypass_parameter__value) {
230
+ return true;
231
+ }
232
+ }
233
+ }
224
234
  return _helper.default.getParam('accept') === '1' || _helper.default.getParam('gtm_debug') !== null;
225
235
  }
226
236
  }, {