Lightweight customizable placeholders for third party content of your website (e.g. Youtube Videos) compatible with the Usercentrics CMP.

Overview

Usercentrics Widgets

Lightweight customizable placeholders for third party content of your website (e.g. Youtube Videos) compatible with the Usercentrics CMP.

  • Unlike the Usercentrics Smart Data Protector, this library does not block third party content automatically. You have to change your website according the documentation in this README!

  • This is based on a community project and no official product from Usercentrics

Quickstart

  1. Setup Usercentrics CMP

  2. For each iframe and script elements you want to edit

    1. change src to data-uc-src
    2. add data-usercentrics="[SERVICE NAME]" with the Name of the matching service form Usercentrics admin area
      1. (for example data-usercentrics="Google Maps" for Google Maps)
    3. add the attribute data-uc-id with the ID of the matching service form Usercentrics admin area (for example data-uc-id="BJz7qNsdj-7" for Youtube)
  3. The Packet can load via NPM

    1. Include in package.json
      "devDependencies": {
           "@netresearch/usercentrics-widgets": "^1.0.7"
      },
      
      or
    2. Install via NPM
      npm install @netresearch/usercentrics-widgets
      
  4. Include and add the files from the /dist/ folder to your template

    1. ucw.min.css into the <head> section:
      <head>
        <link type="text/css" rel="stylesheet" href="ucw.min.css"/>
      </head>
    2. ucw.js (or if you need IE11 support ucw.legacy.js) at the end of your <body>
        <script src="ucw.js"></script>
      </body>
      </html>
  5. Example

    1. IFrame (Google Maps)
      <iframe data-usercentrics="Google Maps" data-uc-id="S1pcEj_jZX" data-uc-src="https://www.google.com/maps/d/u/1/embed?mid=XXX" width="852" height="480"></iframe>
      
    2. External Script (bookingkit)
      <div id="bookingKitContainer" data-cw="6dfd2c67962b9442abd2a28759a7445e"></div>
      <script type="text/plain" data-usercentrics="bookingkit" data-uc-id="Ewb9uz1Rp" data-uc-src="https://4706b1799db005bf104.widget.bookingkit.net/bkscript/XXX/" async></script>
      
    3. Google Tag Manager and scripts without output can still be used as before
      <script type="text/plain" data-usercentrics="Google Tag Manager">
            (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
            new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
            'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
            })(window,document,'script','dataLayer','<f:format.raw>{settings.GoogleTagManagerContainerId}</f:format.raw>');
      </script>
      

Pipeline on github

  • The pipeline is based on Github Actions
  • The pipline build the dist folder and the JavaScript and css files
  • The pipline also runs the tests

Build changes locally

  1. the /dist/ folder contains the latest version of the library
  2. Changes can do in the /src/ folder
  3. Install the library via NPM with npm install
  4. Build the changes with npm run build

Supported technologies

  • all iframes
  • all scripts
  • background images only for Youtube at the moment

Customization

All widgets can be changed via data attributes:

Attribute Description Example
data-uc-src src of the original element data-uc-src="https://www.youtube.com/embed/xxx"
data-text Text for the placeholder data-text="We need your consent"
data-accept Label for the accept button data-accept="ok"

Styling

There is a scss template in the style folder, this is independent of the css file from the dist folder

Instead of using the original predefined CSS file, you can use your own. See /style/ucw.css as a reference which CSS classes need to be defined and /example/customized.html as an example.

You might also like...

Scraper for TikTok. Download videos, music, fetch users info and more.

tiktok-scraper A fast light-weight scraper for tiktok to fetch and download video posts, video music, user info and more. Installation npm i tiktok-sc

Jan 1, 2023

Compress program that uses H264,VP9 and Vorbis algorithms with ffmpeg to compress anime videos and audios

Compress program that uses H264,VP9 and Vorbis algorithms with ffmpeg to compress anime videos and audios

Vaniply Compress tool to compress videos and audios using H264,VP9 and Vorbis algorithms Installation and running Just clone the repository and open a

Oct 15, 2022

Bookwise is a video library web app that consists of a collection of Videos

Bookwise is a video library web app that consists of a collection of Videos

Bookwise is a video library web app that consists of a collection of Videos. It has features such as like videos, creating playlists, adding videos to playlists, adding to watch later, history, feed, etc. but of a specific niche.

Jun 13, 2022

Compress program that uses H264,VP9 and Vorbis algorithms with ffmpeg to compress anime videos and audios

Compress program that uses H264,VP9 and Vorbis algorithms with ffmpeg to compress anime videos and audios

Vaniply Compress tool to compress videos and audios using H264,VP9 and Vorbis algorithms Installation and running Just clone the repository and open a

May 30, 2022

About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this command handler.

discordJS-V14 About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this

Dec 28, 2022

Meet Muffin - a multipurpose, customizable and open source Discord bot with bunch of useful features for your server!

Meet Muffin - a multipurpose, customizable and open source Discord bot with bunch of useful features for your server!

Meet Muffin - a multipurpose, highly customizable and open source Discord bot with bunch of useful features for your server! Self-hosting notice While

Oct 21, 2021

a customizable bot that takes top memes of the day from any r/subreddit and posts them on your instagram page

TAEWONSU a customizable bot that takes top memes of the day from r/subreddit and posts them on your instagram page SetUp install any LTS nodejs (lates

Oct 23, 2022

A self-hosted, completely private and free music streaming server compatible with Synology Audio Station's web browser interface and smartphone apps.

A self-hosted, completely private and free music streaming server compatible with Synology Audio Station's web browser interface and smartphone apps.

Open Audio Server Open Audio Server is a music streaming server compatible with Audio Station by Synology. Audio Station creates your own private serv

Dec 11, 2022

A Whatsapp bot compatible with MultiDevice (MD)

A Whatsapp bot compatible with MultiDevice (MD)

SCIBOT My Favorite Commands : pmpermit - Permission for direct message download - download any video from yt and send it as a voice recording lvl - Th

Dec 3, 2022
Comments
  • Bump minimatch from 3.0.4 to 3.1.2

    Bump minimatch from 3.0.4 to 3.1.2

    Bumps minimatch from 3.0.4 to 3.1.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump terser from 5.7.0 to 5.14.2

    Bump terser from 5.7.0 to 5.14.2

    Bumps terser from 5.7.0 to 5.14.2.

    Changelog

    Sourced from terser's changelog.

    v5.14.2

    • Security fix for RegExps that should not be evaluated (regexp DDOS)
    • Source maps improvements (#1211)
    • Performance improvements in long property access evaluation (#1213)

    v5.14.1

    • keep_numbers option added to TypeScript defs (#1208)
    • Fixed parsing of nested template strings (#1204)

    v5.14.0

    • Switched to @​jridgewell/source-map for sourcemap generation (#1190, #1181)
    • Fixed source maps with non-terminated segments (#1106)
    • Enabled typescript types to be imported from the package (#1194)
    • Extra DOM props have been added (#1191)
    • Delete the AST while generating code, as a means to save RAM

    v5.13.1

    • Removed self-assignments (varname=varname) (closes #1081)
    • Separated inlining code (for inlining things into references, or removing IIFEs)
    • Allow multiple identifiers with the same name in var destructuring (eg var { a, a } = x) (#1176)

    v5.13.0

    • All calls to eval() were removed (#1171, #1184)
    • source-map was updated to 0.8.0-beta.0 (#1164)
    • NavigatorUAData was added to domprops to avoid property mangling (#1166)

    v5.12.1

    • Fixed an issue with function definitions inside blocks (#1155)
    • Fixed parens of new in some situations (closes #1159)

    v5.12.0

    • TERSER_DEBUG_DIR environment variable
    • @​copyright comments are now preserved with the comments="some" option (#1153)

    v5.11.0

    • Unicode code point escapes (\u{abcde}) are not emitted inside RegExp literals anymore (#1147)
    • acorn is now a regular dependency

    v5.10.0

    • Massive optimization to max_line_len (#1109)
    • Basic support for import assertions
    • Marked ES2022 Object.hasOwn as a pure function
    • Fix delete optional?.property
    • New CI/CD pipeline with github actions (#1057)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump minimist from 1.2.5 to 1.2.6

    Bump minimist from 1.2.5 to 1.2.6

    Bumps minimist from 1.2.5 to 1.2.6.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(v1.0.10)
Owner
Netresearch
Impressum: https://www.netresearch.de/impressum/
Netresearch
Play games or watch YouTube videos together on Discord !

Discord Together ?? Installation Install discord-together $ npm install discord-together@latest Install discord.js $ npm install discord.js ?? Featu

RemyK 186 Jan 3, 2023
A JavaScript library for optimizing html pages with video content that prevents videos from loading on mobile devices.

?? js-vido — JavaScript Video Download Optimizer A JavaScript library for optimizing html pages with video content that prevents videos from loading o

Ariel Montes 1 Feb 9, 2021
DownTube is a free to use - Content downloader service that works upon YouTube based open source APIs. It is developed and handled by M30.

?? DownTube 3.1.7 DownTube is a free to use - Content downloader service that works upon YouTube based open source APIs. It is developed and handled b

Dev Anand 1 Sep 5, 2022
A lightweight web component helper for HTML5 videos.

Video Radio Star A lightweight web component helper for HTML5 videos. Intended for use with muted by default HTML5 videos. Demo Demo out of viewport u

Zach Leatherman 58 Dec 12, 2022
LazyLoad Embed YouTube Player - simple and lightweight plugin - pure JavaScript

Youtube LazyLoad LazyLoad Embed Youtube Player - simple and lightweight plugin - pure JavaScript Status View Preview Table of contents Status Quick St

The MUDA Organization 25 Nov 29, 2022
Springlink - ♨️ springlink, a lightweight, fast, highly customizable and stable lavalink wrapper for Node.js 🟩

SpringLink ♨️ A lightweight, fast and stable lavalink wrapper for Node.js Features ?? Stable Feature-rich Customizable Lightweight Installation ?? (No

Knyaoo 3 Nov 17, 2022
Create videos using React!

Reactive Videos are videos created using HTML and React components. This allows you to leverage the almost limitless possibilities of the web browser

Mikael Finstad 76 Dec 25, 2022
A tool to download all videos and convert to mp3 inside a video set of bilibili.

bilibili-video2mp3 A tool to download all videos and convert to mp3 inside a video set of bilibili (also works for single video, of course). You will

wxsm 23 Dec 15, 2022
Um simples bot para o Telegram que baixa vídeos e áudios do TikTok & outras funcionalidades

Kelle Estella (Telegram) Um simples bot para o Telegram que baixa vídeos e áudios do TikTok & outras funcionalidades. Clique aqui para utilizá-lo. Com

Luis Gabriel Araújo 3 Apr 20, 2022
A program that makes scripting videos easier.

A program that makes scripting videos easier. Scripts can be written using only the keyboard.

Samuel Albert 18 Jun 22, 2022