All notable changes to GDPR-Tools will be documented in this file.
- Update
AbstractCmpHelper
class:- Add
evaluate()
method to execute blocked in a controlled context instead of usingeval()
. - Add
cache
property to cache expensive operations throughout the class. - Add
cache()
getter method.
- Add
- Update
AbstractCmpHelper
class:- Make all dispatched events receive the helper object in detail.
- Make all dispatched events cancelable, do not bubble and not composed.
- Update
cmp-helper.config.js
:- Switch listened on event target from document to window.
- Update event listener options to make sure it is the first.
- Add a check for cmpHelper object existence in window.
- Add a check to make sure the listened on event is trusted.
- Update
AbstractCmpHelper
class:- Add new attribute
data-consent-decorates
to allow for teleporting element decoration elsewhere on the DOM. - Add
refresh()
method. - Add
getElementServiceName()
method. - Add
getElementCategoryName()
method. - Add
isDecoratable()
method. - Update
constructor()
method to listen on window resize to update overlay views. - Update
activate()
method to make use ofisDecoratable()
. - Update
deactivate()
method to make use ofisDecoratable()
. - Update
update()
method to change dispatched event name fromCmpHelperElementOnUpdate
toCmpHelperOnUpdate
. - Update
decorate()
method to make use ofdata-consent-decorates
attributes. - Update
undecorate()
method to make use ofdata-consent-decorates
attributes. - Update
createDecoration()
method. - Fix properties and methods DocBlocks.
- Add new attribute
- Update
gdpr-tools.php
:- Make injected script always the first script.
- Recompile
cmp-helper.js
.
NOTE: This update should be fully backwards compatible. Attention may be required for projects using
gdpr-tools.phar
, as the way how the Frontend SDK is added to the document has been changed. It used to be appended to the<body />
element. Starting fromv1.3.0
it will be inserted directly AFTER the<title />
element to make sure it is the first script added to the document. The major change was introduced as some CMPs were prevent GDPR-Tools Frontend SDK from executing using thebeforescriptexecute
event. People using GDPR-Tools as a dependency via Composer shouldn't experience and change in behavior.
- Update
Sanitizer
class:- Add
INJECTION_MODE_*
class constants:INJECTION_MODE_PREPEND
INJECTION_MODE_APPEND
INJECTION_MODE_BEFORE
INJECTION_MODE_AFTER
- Add
INJECTION_MODES
class constant - Add
inject()
method to simplify DOM manipulation. - Add
$prepends
property. - Add
setPrepends()
method. - Add
prepend()
method. - Update
append()
method to make use ofinject()
method.
- Add
- Update
Sanitizer
class:- Update
sanitizeData()
method to add new parameters$prepends
and$injections
. - Update
sanitizeApp()
method to add new parameters$prepends
and$injections
. - Update
getURIs()
method. - Update
getReplaceCallback()
method.
- Update
- Update
gdpr-tools.config.php
:- Add new config fields
prepends
andinjections
.
- Add new config fields
- Update
gdpr-tools.php
.- Make use of the newly created config fields (
prepends
andinjections
).
- Make use of the newly created config fields (
- Update
cmp-helper.config.js
:- Initialize
ConcreteCmpHelper
after document load. - Log some info GDPR-Tools in the console.
- Initialize
- Update tests:
- Update
SanitizerTest
class.
- Update
- No notable changes:
- Fix typos.
- Documentation improvements.
- Update
AbstractCmpHelper
JS class:- Fix typo in
config
variable (config.decoration
->config.decorations
).
- Fix typo in
- Recompile
cmp-helper.js
. - Update
gdpr-tools.php
:- Add return type-hints to helper functions.
- General improvements, better documentation and CS fixes.
- Update
Sanitizer
class:- Make the class not final.
- Add
$appends
property. - Add
setAppends()
method. - Add
bootstrap()
method. - Update
getReplaceCallback()
method:- Add new attribute
data-consent-alternative
to the sanitized elements.
- Add new attribute
- Update
sanitizeData()
method. - Update
sanitizeApp()
method.
- Add
AbstractCmpHelper
JS class. - Add
ConcreteCmpHelper
JS class. - Add
main.js
JavaScript SDK entry file. - Add
cmp-helper.js
(compiled JavaScript SDK). - Add
cmp-helper.config.js
(JavaScript SDK config file). - Add
gdpr-tools.php
file. - Add
gdpr-tools.config.php
file. - Add
main.php
package entry file. - Add
compile
executable. - Update tests.
This update is a breaking change if the
$appends
argument insanitizeData()
and/orsanitizeApp()
methods is used.
- Update
Sanitizer
class:- Add
$whitelist
property. - Add
setWhitelist()
method. - Update
sanitizeData()
method by adding a new arguments. - Update
sanitizeApp()
method by adding a new arguments. - Add
getDomains()
method. - Update
getSearchPattern()
method to make use of whitelisted domains.
- Add
- Update tests:
- Update
SanitizerTest
class.
- Update
- Update
Sanitizer
class:- Update
sanitizeApp()
method to prevent infinite loops when closing open buffers.
- Update
- Initial release.