1.0.0 • Published 5 years ago
fixed-stub-iabtcf v1.0.0
@iabtcf/stub
Fixed Cmp API Stub code (for iframe purposes).
Generation of lib file
terser src/stub.js --ecma 5 -m -c -o lib/stub.jsInstallation
npm
npm install fixed-iabtcf-stubUsing
include via module loading
import * as cmpstub from 'fixed-iabtcf-stub/stub';or
const cmpstub = require('fixed-iabtcf-stub/stub');then execute:
cmpstub();this should generate the __tcfapi() window function with the queing functionality.
to drop on a page
git clone https://github.com/InteractiveAdvertisingBureau/iabtcf-es.git
cd iabtcf-es/modules/stub/
yarn // or npm install
yarn build // or npm run buildBuilt stub will be output to ./lib
Getting queue of commands
const queue = __tcfapi();
console.log(queue); // [ ['command', 2, callback], ...]1.0.0
5 years ago