Problem/Motivation
If you override some part of the copyprevention
config in your settings.php file it is not respected. In my case, it's the settings.local.php file, because I want to bypass some behaviour locally.
Steps to reproduce
Open the module Admin UI /admin/config/user-interface/copyprevention
and enable some "Body tag attributes":
[√] Disable text selection: onselectstart="return false;"
[√] Disable copy to clipboard: oncopy="return false;"
Click [Save]
Run the following drush command and confirm the configuration has been saved:
drush config:get copyprevention.settings
Add the following lines to settings.php (or settings.local.php if you are using it):
$config['copyprevention.settings']['copyprevention_body']['selectstart'] = 0;
$config['copyprevention.settings']['copyprevention_body']['copy'] = 0;
Run the following drush command to confirm the override is technically "working":
drush config:get copyprevention.settings --include-overridden
Visit your site as an anonymous user and notice that you still can't select text or copy to clipboard because the overridden config is not respected.