Commit 4e04fb30 authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Issue #3323225 by Grevil, Anybody: Add COOKIES submodule for asset_injector support

parent ca3bff7e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
        "drupal/ivw_integration": "^2.0",
        "drupal/matomo": "^1.0",
        "drupal/recaptcha": "^3.0",
        "drupal/media_entity_twitter": "^2.0"
        "drupal/media_entity_twitter": "^2.0",
        "drupal/asset_injector": "^2"
    }
}
+30 −0
Original line number Diff line number Diff line
# COOKiES Asset Injector
## Introduction
The "COOKiES Asset Injector" module implements a way to block javascript code
injected by the "Asset Injector" module using COOKiES Services and its consent
configuration.

## Requirements

This module requires the COOKiES and Asset Injector modules:
- COOKiES (https://www.drupal.org/project/cookies)
- Asset Injector (https://www.drupal.org/project/asset_injector)

## Installation

- Install as you would normally install a contributed Drupal module. Visit
https://www.drupal.org/node/1897420 for further information.

## Usage
- Go to the JS Asset Injector creation page
("/admin/config/development/asset-injector/js/add") or edit an existing
js asset injector entity
("/admin/config/development/asset-injector/js/my_js_injector")
- Scroll down and you will see the "COOKiES Integration" setting
- Here you can set the COOKiES service this asset entity belongs to.

**ATTENTION**
- If you specify a COOKiES service, where consent is **NOT** required, the
asset will always execute, as user consent is assumed.
- Also note, that the asset injector "preprocess" option is **NOT** compatible
with the COOKiES integration.
+8 −0
Original line number Diff line number Diff line
asset_injector.js.*.third_party.cookies_asset_injector:
  type: mapping
  label: 'Asset injector COOKiES third party settings'
  mapping:
    cookies_service:
      type: string
      label: 'COOKiES Service'
      translatable: false
+12 −0
Original line number Diff line number Diff line
name: 'COOKiES Asset Injector'
type: module
description: 'Submodule of COOKiES to integrate Asset Injector assets with COOKiES Services and its consent configuration.'
core_version_requirement: ^9.3 || ^10
package: 'COOKiES'
dependencies:
  - cookies:cookies
  - asset_injector:asset_injector
test_dependencies:
  - asset_injector:asset_injector
libraries:
  - cookies_asset_injector/cookies_asset_injector
+6 −0
Original line number Diff line number Diff line
consentHandler:
  version: VERSION
  js:
    js/consentHandler.js: {}
  dependencies:
    - core/drupalSettings
Loading