Skip to content

Commit 44de99e

Browse files
yagovelazquezfreestardependabot[bot]jlaso3linkAdmixerTech
authored
Prebid 8.40.0 (#176)
* Bump github/codeql-action from 2 to 3 (#10856) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * HadronId Module: implementing user consent in backend calls (#10845) * Implementing user consent in HadronId module * fixing tests accepting just the start of url * Eids Docs : add missing EID examples (#10844) * Add missing brackets * Add missing examples * Add back missing ext * Admixer Bid Adaper: add admixerwl alias (#10859) * Update README.md update * Add admixerwl alias for admixerBidAdapter. --------- Co-authored-by: Yaroslav Masenko <[email protected]> * AdagioAnalyticsAdapter: fix function param check (#10860) * NoBid Analytics Adapter: support for counting blocked requests for the Optimizer (#10842) * Enable supplyChain support * Added support for COPPA * rebuilt * Added support for Extended User IDs. * Added support for the "meta" attribute in bid response. * Delete nobidBidAdapter.js.orig * Delete a * Delete .jsdtscope * Delete org.eclipse.wst.jsdt.ui.superType.container * Delete org.eclipse.wst.jsdt.ui.superType.name * Delete .project * Added support for counting blocked requests for the Optimizer. * Added missing function for testing. * Added unit tests --------- Co-authored-by: Reda Guermas <[email protected]> * consentManagementGpp: fix handling of CMP errors (#10811) * Taboola Bid Adapter: implement Iframe user sync (#10789) * iframe-sync * iframe-sync-add-tests * AMX bid adapter: fix timeout handler, bump version (#10744) * amx bid adapter: fix timeout handler, bump version * restore package-lock to master * remove sendbeacon, use mock xhr * add keepalive option for ajax * fix firefox test * CR changes * CR changes: restore files * CR changes * Ucfunnel Bid Adapter: add format support (#10862) * Add a new ucfunnel Adapter and test page * Add a new ucfunnel Adapter and test page * 1. Use prebid lib in the repo to keep updated 2. Replace var with let 3. Put JSON.parse(JSON.stringify()) into try catch block * utils.getTopWindowLocation is a function * Change to modules from adapters * Migrate to module design * [Dev Fix] Remove width and height which can be got from ad unit id * Update ucfunnelBidAdapter to fit into new spec * Correct the endpoint. Fix the error of query string * Add test case for ucfunnelBidAdapter * Fix lint error * Update version number * Combine all checks on bid request * Add GDPR support for ucfunnel adapter * Add in-stream video and native support for ucfunnel adapter * Remove demo page. Add more test cases. * Change request method from POST to GET * Remove unnecessary comment * Support vastXml and vastUrl for video request * update TTL to 30 mins * Avoid using arrow function which is not discuraged in mocha * ucfunnel tdid support * ucfunnel fix error message in debug mode * ucfunnel adapter add bidfloor parameter * ucfunnel adapter support CCPA * ucfunnel adapter native support clicktrackers * ucfunnel adapter change cookie sync setting * ucfunnel adapter update request parameter * Update ucfunnelBidAdapter * ucfunnel adapter add currency in ad response * ucfunnel adapter support uid2 * ucfunnel Bid Adapter: add support for FLoC and Verizon Media ConnectID * ucfunnel Bid Adapter: add support Price Floors Module * ucfunnel Bid Adapter: add GPID support and fix page and domain parameter. * ucfunnel Bid Adapter: add format support. --------- Co-authored-by: root <[email protected]> Co-authored-by: Ryan Chou <[email protected]> Co-authored-by: ucfunnel <[email protected]> Co-authored-by: jack.hsieh <[email protected]> * R2B2 Bid Adapter: Initial release (#10702) * R2B2 bidder adapter * R2B2 bid adapter: fix * conditional renderer --------- Co-authored-by: jenda <[email protected]> * Core: fix headers in ortbConverter readme (#10874) * SparteoBidAdapter: Add UserSync (#10822) * Yandex Bid Adapter: Add rtt (roud trip time) tracking via nurl (#10846) * Add rtt (roud trip time) tracking via nurl in yandexBidAdapter * Yandex Bid Adapter: Fix let -> const --------- Co-authored-by: Konstantin Korobkov <[email protected]> * AdMatic Bid Adapter : consent management features added (#10813) * Admatic Bidder Adaptor * Update admaticBidAdapter.md * Update admaticBidAdapter.md * remove floor parameter * Update admaticBidAdapter.js * Admatic Bid Adapter: alias and bid floor features activated * Admatic adapter: host param control changed * Alias name changed. * Revert "Admatic adapter: host param control changed" This reverts commit de7ac85981b1ba3ad8c5d1dc95c5dadbdf5b9895. * added alias feature and host param * Revert "added alias feature and host param" This reverts commit 6ec8f4539ea6be403a0d7e08dad5c7a5228f28a1. * Revert "Alias name changed." This reverts commit 661c54f9b2397e8f25c257144d73161e13466281. * Revert "Admatic Bid Adapter: alias and bid floor features activated" This reverts commit 7a2e0e29c49e2f876b68aafe886b336fe2fe6fcb. * Revert "Update admaticBidAdapter.js" This reverts commit 7a845b7151bbb08addfb58ea9bd5b44167cc8a4e. * Revert "remove floor parameter" This reverts commit 7a23b055ccd4ea23d23e73248e82b21bc6f69d90. * Admatic adapter: host param control && Add new Bidder * Revert "Admatic adapter: host param control && Add new Bidder" This reverts commit 3c797b120c8e0fe2b851381300ac5c4b1f92c6e2. * commit new features * Update admaticBidAdapter.js * updated for coverage * sync updated * Update adloader.js * AdMatic Bidder: development of user sync url * Update admaticBidAdapter.js * Set currency for AdserverCurrency: bug fix * Update admaticBidAdapter.js * update * admatic adapter video params update * Update admaticBidAdapter.js * update * Update admaticBidAdapter.js * update * update * Update admaticBidAdapter_spec.js * Update admaticBidAdapter.js * Update admaticBidAdapter.js * Revert "Update admaticBidAdapter.js" This reverts commit 1216892fe55e5ab24dda8e045ea007ee6bb40ff8. * Revert "Update admaticBidAdapter.js" This reverts commit b1929ece33bb4040a3bcd6b9332b50335356829c. * Revert "Update admaticBidAdapter_spec.js" This reverts commit 1ca659798b0c9b912634b1673e15e54e547b81e7. * Revert "update" This reverts commit 689ce9d21e08c27be49adb35c5fd5205aef5c35c. * Revert "update" This reverts commit f381a453f9389bebd58dcfa719e9ec17f939f338. * Revert "Update admaticBidAdapter.js" This reverts commit 38fd7abec701d8a4750f9e95eaeb40fb67e9f0e6. * Revert "update" This reverts commit a5316e74b612a5b2cd16cf42586334321fc87770. * Revert "Update admaticBidAdapter.js" This reverts commit 60a28cae302b711366dab0bff9f49b11862fb8ee. * Revert "admatic adapter video params update" This reverts commit 31e69e88fd9355e143f736754ac2e47fe49b65b6. * update * Update admaticBidAdapter.js * Update admaticBidAdapter_spec.js * mime_type add * add native adapter * AdMatic Adapter: Consent Management * Taboola Bid Adapter: Cookie Look Up Logic Fix (#10873) * cookie-look-up-logic-fix * cookie-look-up-logic-fix * cookie-look-up-logic-fix * ZetaGlobalSsp Bid Adapter : support topics module (#10803) * add getTopics() * provide get segments from ortb2 * rename const * additional check * fix test --------- Co-authored-by: Surovenko Alexey <[email protected]> Co-authored-by: Alexey Surovenko <[email protected]> * Adnuntius Bid Adapter: bugfix for storageFunction (#10869) * Removed linting issues * Fixed merge issues. * Bugfix on storageTool. * Prebid 8.29.0 release * Increment version to 8.30.0-pre * Yandex Bid Adapter: add support for topicsFpdModule (#10875) * Yandex Bid Adapter: add support for topicsFpdModule * add test * Yandex Bid Adapter: add jsdoc (#10884) * DxKulture Bid Adapter : user syncs improvements (#10738) * Initial implementation of kulturemedia bid adapter * Changing outstream to instream * Enriching md file with test examples * Changing nId to networkId * Cleaning up md file * Submitting rebranded dxkultureBidAdapter * dxkultureBidAdapter - Improve UserSyncs * Include gdpr/usp params in iframe usersync url * Add gdpr/usp data to iframe usync urls * Cleaning up testing html file * Adding outstream support * Updating exchange endpoint * Resolve requests test * Resolving iframe/pixel priority when iframeEnabled/pixelEnabled * Improving userSync filtering condition * Prioritize iframe user syncing --------- Co-authored-by: Danijel Predarski <[email protected]> Co-authored-by: dani-nova <[email protected]> Co-authored-by: Slavisa Petkovic <[email protected]> Co-authored-by: Slavisa Petkovic <[email protected]> * Mygaru Id System: Initial release (#10848) * Update viantOrtbBidAdapter_spec.js (#10888) Added a test case for native ads * Stv Bid Adapter: added user id support, adaptation of schain support (#10849) * initial commit * adapted buildRequests function * refinement pfilter and bcat * refinement * adapted tests for isBidRequestValid,buildRequests * adaptations for test * finished building stvBidAdapter.js * finished: ran tests, coverage 99% * update: rename w->srw, h->srh * adapt stvBidAdapter.md * remove dspx from stv adapters * some changes (missing: getUserSyncs, but is the same as in radsBidAdapter) * added checks in getUserSyncs; ran tests * added schain support (94.8% coverage) * correct schain encoding * added serializeUids and adapted serializeSChain --------- Co-authored-by: theo_ <theo_@IDEA3> * Missena Bid Adapter: allow per page capping (#10863) * LiveIntent ID Module: Update live-connect version (#10894) * update lc version * fix typo * Do not require API for video requests (#10895) * Price Floors: Failure to Account for 'data.skipRate' (#10872) * Update skipRate handling in priceFloors.js and add unit tests for the changes. * Update wording on tests and remove unecessary spread. * Prebid 8.30.0 release * Increment version to 8.31.0-pre * 1.Added safechecks for s2s metadapter case 2.Skipped firing client side tracker for pubmatic 3.Skipped adding pubmatic bid in logger (#10897) * Discovery Bid Adapter: update buyerId, add ssppid & pmguid, add getUserSyncs (#10800) * ID5 User Id module - pass gpp string and sid in getId request (#10899) * Adnuntius Bid Adapter : bugfix void au ids (#10890) * Removed linting issues * Fixed merge issues. * Bugfix on storageTool. * Adnuntius Bid Adapter: bugfix handling ad response Handle no voidAuIds better. --------- Co-authored-by: Mikael Lundin <[email protected]> Co-authored-by: Mikael Lundin <[email protected]> * GreenbidsAnalyticsAdapter and GreenbidsRtdProvider: Rework greenbids sampling and improve transparency (#10792) * track billing events and modify sampling pattern * review updates * Core: add eslint-plugin-jsdoc (#10893) * Pangle Bid Adapter : add multi format support (#10909) * feat: pangle multi format * feat: multi format * Criteo bid adapter: remove checks on video context and placement (#10912) Those checks are no longer useful so we decided to remove them. * Discovery Bid Adapter : add title, description, keywords (#10900) * Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm add unit test resolve conflict * Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm add unit test --------- Co-authored-by: lvhuixin <[email protected]> * Ampliffy Bid Adapter: initial commit (#10883) * ampliffyBidAdapter initial commit * Add tests * Utils.js (Warning in Integration Tests): add back getWindowFromDocument (#10865) * add back getWindowFromDocument * do not use core for 1 consumer --------- Co-authored-by: Demetrio Girardi <[email protected]> * Rubicon: remove transformBidParams function (#10919) Per https://github.com/prebid/Prebid.js/issues/6361 Confirmed that the server-side adapters for both PBS-Go and PBS-Java handle the type conversion. * Bump follow-redirects from 1.15.2 to 1.15.4 (#10922) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Support cdep (#10921) Changes to bid adapter logic and tests to support passing `cdep` along in requests to Sharethrough's adserver endpoint. * Adkernel Bid Adapter: multiformat imp splitting (#10918) * Adkernel: multiformat adunit support * fix * Geodge RTD module: update preload mechanism (#10911) * Update preload mechanism to work with an iframe * Update tests --------- Co-authored-by: daniel manan <[email protected]> * Add option for no signal bidders (#10867) * Criteo bid adapter: add device object to backend request (#10926) * Geolocation RTD provider: make module 'vendorless' for the purposes of TCF (#10931) * LiveConnect Bid Adapter : add prebid version to liveConnect (#10920) * forward trackerVersion * refactoring * adjust test * use a proper lc version * adjust test * refactoring * test case * lint * package-lock * fix test * fix test * Insticator Bid Adaptor : add support for playerSize, plcmt, vastXML, & vastURL (#10903) * enhance insticatorBidAdapter: - support playerSize for video - Support plcmt tag for video * conditionall check for playerSize * - remove hardcoded banner type for video - Support vastXml and vasturl for video bids * remove trailing spaces * refactor spaces * add unit tests * Seedtag Bid Adapter : add geom to bidRequest (#10906) * add adunit geometry parameter to the bid request * lint * add unit test * add size check * use global slot for all tests * fix test when slot is not available$ * add dsp_genieeBidAdapter (#10834) Co-authored-by: kiyoshi fujiwara <[email protected]> * Contxtful RTD Provider: Initial Release (#10550) * feat: added contxtfulRtdProvider * fix: removed id in query param * fix: googletag * doc: typo * fix: added contxtful in adloader * doc: extra line * fix: added connector config option * Prebid 8.31.0 release * Increment version to 8.32.0-pre * Ad2iction Bid Adapter: initial release (#10877) * Import the project * Update version * fix: typo * refactor: rewrite * feat: add pre-defined function & add logger * feat: add test for bid adapter * feat: add readme for ad2iction bid adaptor * feat: remove unneeded callback event * feat: lint & add missing test * feat: remove debugger flag * feat: refactor & new feature for adapter * feat: update Maintainer & Description info --------- Co-authored-by: Richard Lee <[email protected]> Co-authored-by: Charlie <[email protected]> * LiveIntent UserId module: Make process and process.env optional (#10905) * Drop the minimal mode * Revert "Drop the minimal mode" This reverts commit 9f33731a528d4b5e45e526c46303f9ae729cb290. * Make process and process.env optional * Revert changes in spec * Use pbjsGlobals for confguring moduleMode * Bump LiveConnect version * Smartadserver Bid Adapter: support additional video parameters (#10815) * Smartadserver Bid Adapter: Add support for SDA user and site * Smartadserver Bid Adapter: Fix SDA support getConfig and add to unit testing * support floors per media type * Add GPP support * Rework payloads enriching * Add gpid support * Support additional video params * vpmt as array of numbers * Fix comment --------- Co-authored-by: Meven Courouble <[email protected]> Co-authored-by: Krzysztof Sokół <[email protected]> * Core: fix jsdoc errors (#10941) * Richaudience Bid Adapter : add function onTimeout (#10891) * RichaudienceBidAdapter add function onTimeout * Add unit test * revert: Revert changes in integrationExamples/creative.html * fix: Remove useless package in richaudiences test module --------- Co-authored-by: Sergi Gimenez <[email protected]> * PubMatic Bid Adapter : add support to read and pass badv to adserver (#10943) * Added support for badv parameter of ortb2 * Added test cases --------- Co-authored-by: pm-azhar-mulla <[email protected]> * Taboola Bid Adapter : refactor using ortb conversion library (#10910) * refactor using ORTB conversion library * refactor using ORTB conversion library * refactor using ORTB conversion library * refactor using ORTB conversion library --------- Co-authored-by: ahmadlob <[email protected]> * [Fledge] Add support for seller signals per imp (#10948) Load seller signals for each impression and include them with the response level seller signals before returning the bid and fledge auction config. * Adman Bid Adapter : add GVLID (#10949) * Add Adman bid adapter * Add supportedMediaTypes property * Update ADman Media bidder adapter * Remove console.log * Fix typo * revert package-json.lock * Delete package-lock.json * back to original package-lock.json * catch pbjs error * catch pbjs error * catch pbjs error * log * remove eu url * remove eu url * remove eu url * remove eu url * remove eu url * Update admanBidAdapter.js add consnet to sync url * Update admanBidAdapter.js fix import * Update admanBidAdapter.js lint fix * Update admanBidAdapter.js lint fix * Update admanBidAdapter.js check consent object data availability * сompatible with prebid v5 * add Lotame Panorama ID * update getUserSyncs * fix * fix tests * remove package-lock.json * update sync url * update test * add idx (UserID Module) * update tests * remove traffic param * handle transactionID param * send transactionID param in imp.ext * rename transactionID to transactionId * update tests * additional content handle * rollback content * content handle via hb integration * update gdprConsent * return old package-lock * add GVLID * rem package-lock.json from changes --------- Co-authored-by: minoru katogi <[email protected]> Co-authored-by: minoru katogi <[email protected]> Co-authored-by: ADman Media <[email protected]> Co-authored-by: SmartyAdman <[email protected]> Co-authored-by: SmartyAdman <> * Unicorn Bid Adapter : support id5 (#10947) * support id5 * fix lint change quote * Yahoo SSP Bid Adapter : update maintainer email address (#10954) * change * removing global filtet * reverting page * message * adapter change * remove space * renderer exist case * reverting package-lock.json * adding schain object * adding tagid * syntaxx error fix * video.html * space trailing * space * tagid * inventoryId and placement * rewarded video * comment * update maintainer email address --------- Co-authored-by: Deepthi Neeladri Sravana <[email protected]> Co-authored-by: Deepthi Neeladri Sravana <[email protected]> Co-authored-by: Deepthi Neeladri Sravana <[email protected]> Co-authored-by: dsravana <[email protected]> * EUID Id Module : add support for client side token generation (#10885) * enable cstg for euid * test added for euid cstg * fixed euid cstg test and updated docs * add alias support to riseBidAdapter (#10956) * Richaudience Bid Adapter): change url tracking (#10963) * RichaudienceBidAdapter add function onTimeout * Add unit test * revert: Revert changes in integrationExamples/creative.html * fix: Remove useless package in richaudiences test module * Change referer with host * Fix(RichaudienceBidAdapter): Change url tracking * deploy * change test --------- Co-authored-by: Sergi Gimenez <[email protected]> * Prebid 8.32.0 release * Increment version to 8.33.0-pre * Send experian rtid in the bid request payload (#10961) * Tagoras Bid Adapter : Initial release (#10826) * MinuteMediaPlus Bid Adapter: pass gpp consent to userSync server. * tagorasBidAdapter submission * update maintainer * Remove unneeded GVLID. * Adjust syncs condition logic in tagorasBidAdapter. * Insticator Bid Adapter: support optional video params (#10969) * add support for video params acc to ortb2.5 * update the optionalParams logic for buildVideo * update check for protocols * udpate validation for video params and added test case * pass document instance to custom renderer (#10959) * Oxxion Rtd Module: tracking time to run (#10955) * Oxxion Rtd Module: tracking time to run * Oxxion Rtd Module: tracking time to run * Oxxion Rtd Module: tracking time to run * IQX Bid Adapter : initial release (#10952) * new adapter - IQX * chang maintainer --------- Co-authored-by: Chucky-choo <[email protected]> * AJA Bid Adapter: add Global Placement ID support, remove native/video ad support (#10945) * add gpid support, remove native/video ad support * also added cdep support * AdFusion Bid Adapter : currency support (#10938) * adfusion bid adapter test * Add adapter and docs * add currency support * kick of integration tests --------- Co-authored-by: Łukasz <[email protected]> Co-authored-by: Chris Huie <[email protected]> * [TECH-6244] fix: add gvlid to adot adapter (#11) (#10975) * Agma Analytics Module : fix getting global config data (#10968) * Fix getting global config data * Increase internal version number * ID5 ID Module : ID5 will be able to optionally delegate its logic to an external module (#10742) * id-7317 Adding ability to load exernal module by param configuration * id-7317 Fixing bugs with id5 external module * id-7313 Addinf documentation to new externalModuleUrl parameter * id-7317 Typo * id-7317 Fix Lint error * id-7317 Some improvements from PR * id-7317 Some test iprovements * id-7317 Using loadExternalScript() utility instead of loading the script directly * id-7317 Lint error * id-7317 Fixing nb increments * ID5 User Id module - pass gpp consent data to external module --------- Co-authored-by: abazylewicz <[email protected]> Co-authored-by: abazylewicz-id5 <[email protected]> * JSdoc Lint Fixes for Multiple ID Modules (#10972) * fixes jsdoc * fix id jsdocs * jsdoc id fixes * jsdoc id fixes * fix id module lint * id lint fixes * fix lint jsdoc * jslint fixes * id jsdoc lint fix * jsdoc lint fixes * JSdoc Linting Fixes for Multiiple RTD Modules (#10973) * fix rtd jsdoc * jsdoc lint fixes * import jsdoc types * rtd jsdoc fixes * Insticator Bid Adaptor: add support for bidder video params (#10976) * add support for bidder video params * add comment for bidderspecific override * fix video validation empty condition * fix test case * Conversant adapter: use ortbConverter to handle requests and responses (#10913) Co-authored-by: johwier <[email protected]> * Missena Bid Adapter: send cookieDeprecationLabel and prebid version (#10979) * zMaticoo Bid Adapter : Initial Release (#10881) * feat:zMaticoo Bid Adapter for Prebid.js * feat:zMaticoo Bid Adapter for Prebid.js * feat:fix some code style * feat:fix some code style * feat:update package-lock.json --------- Co-authored-by: adam <L12354*。com> * MediaGo Bid Adapter : add pmguid, title, description, keywords and synchronize mguid from third party cookie to first party cookie. (#10923) * MediaGo Bid Adapter : update buyerId and add pmguid,title, description and keywords. * Discovery Bid Adapter : not filter params (#10965) * feat(isBidRequestValid): just filter token once. not filter publisher and tagid * feat(isBidRequestValid): add unit test * feat(spec): fix eslint * feat(spec): fix unit test * feat(spec): fix unit test --------- Co-authored-by: yubei01 <[email protected]> * appnexus Bid Adapter - DSA support (#10971) * NextMillennium Bid Adapter : currency support in request (#10871) * added support for gpp consent string * changed test for nextMillenniumBidAdapter * added some tests * added site.pagecat, site.content.cat and site.content.language to request * lint fix * formated code * formated code * formated code * pachage-lock with prebid * pachage-lock with prebid * formatted code * added device.sua, user.eids * formatted * fixed tests * fixed bug functio getSua * currency * currency * Core & PBS adapter: fix race condition between network timeout and auction timeout (#10779) * Core: fix race condition between fetch timeout and auction timeout * PBS adapter: fix race condition between ajax timeout and auction timeout * Prebid 8.33.0 release * Increment version to 8.34.0-pre * Discovery Bid Adapter : synchronize mguid from third party cookie to first party cookie (#10927) * Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm add unit test resolve conflict * Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm add unit test * Discovery Bid Adapter : synchronize mguid from third party cookie to first party cookie --------- Co-authored-by: lvhuixin <[email protected]> * JSdoc Lint Fixes for Multiple Adapters (#10967) * fix native * update ablida adgeneration * fix adkernel admatic * update type imports * js lint fixes * jslint appnexus * jslint jsdoc fixes * fix jsdoc warnings * lint fixes * lint fix * jsdoc updates * Update adgenerationBidAdapter.js * fix js doc * jsdoc type imports * jsdoc type updates * add types for jsdoc * jsdoc type updates * add types * jsdoc types added * import types * jsdoc updates * jsdoc type imports * type jsdoc import fixes * jsdoc type imports * jsdoc type import fix * lint fixes * fix jsdoc types * type imports * lint fixes jsdoc * jsdoc fixes * type imports for jsdoc * jsdoc type fixes * fxes for jsdoc types * jsdoc fixes * update mail (#10992) * Grid bid adapter : do not send topics along requests to the backend (#10995) * dfpAdServerVideo: add several parameters do DFP URLs (#10977) * SmileWanted - Add Video Instream, Video Outstream and Native support (#10996) Co-authored-by: QuentinGallard <[email protected]> * GC-179 Simpliy the userId module, and added feature to allow customers to provide custom EIDs (#11004) * E2E testing: Remove @wdio/sync and update @wdio/* to the latest (#10990) * Remove @wdio/sync and update the rest of the @wdio packages * Update the e2e tests to use async/await * Add support for local e2e testing * Update circleci to Node 16 * Update the min Node version to 12 and a a node check for e2e tests * Fix the Node version check error * Yandex Analytics Adapter: initial release (#10876) * Yandex Analytics Adapter: Initial release * Release preparations * Updated trackable events * Updated trackable events * tag URL * Added tests and chanded init logic * Fixed already loaded script scenario * One level of object destruction * Global domain, yandex.com * Removed script insertion logic * Update yandexAnalyticsAdapter.md --------- Co-authored-by: Stanislavsky34200 <[email protected]> * MgidX Bid Adapter: add optional region param (#10612) * new adapter - MgidX * add new required param host * rem host, add region --------- Co-authored-by: Evgeny Nagorny <[email protected]> Co-authored-by: xmgiddev <> * Video module: log error when adUnit provides unknown player div ID (#10664) * Video module: log error when adUnit provides unknown player div ID * moves error logging to separate function * remove trailing spaces * Update modules/videoModule/coreVideo.js --------- Co-authored-by: Karim Mourra <[email protected]> * ZetaGlobalSsp: bugfix (#10882) Co-authored-by: Surovenko Alexey <[email protected]> Co-authored-by: Alexey Surovenko <[email protected]> * Yieldmo Bid Adapter : send topics in the Bid Request (#10892) * Adding topics to bid request Getting topics and adding them to bid request. * converting topics to numbers * Adding unit tests * SilverMob adapter initial commit (#10896) * Update appnexusBidAdapter.js (#11009) * Topics fpd module : fix for intermitent failing test (#11013) * test pr for circleci * fix for failing topicsFpdModule tests * formatting fix * minor refactor * triggered another circle ci build * Appnexus Bid Adapter: Update DSA field names (#11027) * Adding gpc in the bid request (#11028) * Livewrapped Bidder: add support for ortb2imp (#11026) * Added support for the Price Floors Module * Use the ad server's currency when getting prices from the floors module * Default to USD if the ad server's currency can't be retrieved * Set the default currency at the right place * Added tests and made a minor change in how device width and height are calculated * Only include flrCur when ad requests contain floors * Use ortb native * Read ortb2imp --------- Co-authored-by: msmeza <[email protected]> * BeOp Bid Adapter: add eids support (#11025) * BeOp Bid Adapter: Add eids support (#14) * Fix tests * AdagioBidAdapter: don't try to compute slot position if element is hidden (#11033) * priceFloors: do not log error on missing floor definitions (#11037) * Prebid 8.34.0 release * Increment version to 8.35.0-pre * OpenX Bid Adapter: add ortb2Imp to PAAPI auctionSignals (#11012) * OpenX Bid Adapter: add ortb2Imp to PAAPI auctionSignals * Use imp instead of searching ortbRequest * ZetaGlobalSsp Bid Adapter : cleanup object (#11049) * ZetaGlobalSsp adapter: cleanup object * Update zeta_global_sspBidAdapter.js --------- Co-authored-by: Surovenko Alexey <[email protected]> Co-authored-by: Alexey Surovenko <[email protected]> Co-authored-by: Chris Huie <[email protected]> * zmaticoo Bid Adapter : add support for video (#11016) * feat:zmaticoo adapter for video Signed-off-by: adam <L12354*。com> * feat:just test ci/circleci:build failed Signed-off-by: adam <L12354*。com> * feat:add unit test Signed-off-by: adam <L12354*。com> * feat:fix response.seatbid and advertiserDomains empty Signed-off-by: adam <L12354*。com> * feat:add unit test Signed-off-by: adam <L12354*。com> --------- Signed-off-by: adam <L12354*。com> Co-authored-by: adam <L12354*。com> * ZetaGlobalSsp: provide device.sua object (#11050) Co-authored-by: Surovenko Alexey <[email protected]> Co-authored-by: Alexey Surovenko <[email protected]> * Rise BidAdapter : add support for gpp (#11051) * support gpp in rise and minutemedia * modified tests * removed mm gpp support * updated rise test * fix for gpp section --------- Co-authored-by: Inna Yaretsky <> * MinuteMedia BidAdapter : add support for gpp (#11052) * add Rise adapter * fixes * change param isOrg to org * Rise adapter * change email for rise * fix circle failed * bump * bump * bump * remove space * Upgrade Rise adapter to 5.0 * added isWrapper param * addes is_wrapper parameter to documentation * added is_wrapper to test * removed isWrapper * Rise Bid Adapter: support Coppa param (#24) * MinuteMedia Bid Adapter: support Coppa param (#25) * Revert "MinuteMedia Bid Adapter: support Coppa param (#25)" (#26) This reverts commit 66c4e7b46121afc5331c8bca6e2fc972fc55f090. * bump * update coppa fetch * setting coppa param update * update Coppa tests * update test naming * Rise Bid Adapter: support plcmt and sua (#27) * update minuteMediaBidAdapter - support missing params (#29) * support gpp for minutemedia adapter * removed spaces * removed extra character --------- Co-authored-by: Noam Tzuberi <[email protected]> Co-authored-by: noamtzu <[email protected]> Co-authored-by: Noam Tzuberi <[email protected]> Co-authored-by: Laslo Chechur <[email protected]> Co-authored-by: OronW <[email protected]> Co-authored-by: lasloche <[email protected]> Co-authored-by: YakirLavi <[email protected]> Co-authored-by: YakirLavi <[email protected]> Co-authored-by: Inna Yaretsky <> * feat: remove dependency on EID Allowlist [ADDR-2801] (#10988) Co-authored-by: Sajid Mahmood <[email protected]> * Bump release-drafter/release-drafter from 5 to 6 (#11053) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5...v6) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Criteo bid adatper: add logic to handle dsa in bid request/response (#11043) Co-authored-by: v.raybaud <[email protected]> * Onetag Bid Adapter: add DSA support (#11036) Co-authored-by: federico <[email protected]> * Add GVLID to illuminBidAdapter module. (#11060) * PGAMSSP Bidder Adapter: add id5id (#11024) * new adapter PGAMSSP * upd * support UID 2.0 * del obj * Add id5id * Missena Bid Adapter: add session identifier (#11058) * Grid bid adapter: add logic to handle dsa in bid request/response (#11042) Co-authored-by: v.raybaud <[email protected]> * Sharethrough Bid Adapter: support Fledge + refine video-placement req logic (#11048) * Modify value-setting logic for video-placement reqs * Updating value-setting logic in `buildRequests()` method so that `placement` property in video requests does not possibly get overridden to 1 as a value if `plcmt` is also present as a property. (Current logic sets `placement` at 1 if `context` is "instream".) * Support for Fledge * Adding updates to our unit tests and the relevant methods in our bid adapter to make it ready, eventually, for Fledge auctions. * Innity Bid Adapter: handle empty response from server (#10960) * Handle empty response from server * Add space before blocks and add unit test for result with no bids * Add skippedReason property to floorData. (#11040) * GumGum Bid Adapter: fix size in the bid response for multi size slot sizes (#11064) * Fix for the multi-size in- slot * added comment * Addition of ImproveDigital's Topics API iframe (#10986) * Core: use same transaction ID for twin ad units (#10962) * swith transactionId to adUnitId * use same TID for ad units with the same code * fix appnexus clones * snigel Bid Adapter : pass more information to backend (#10987) * snigelBidAdapter: pass more information to backend * snigelBidAdapter: add unit tests for the new functionality * rayn rtd provider module (#11054) Co-authored-by: Berislav Kovacki <[email protected]> * mediasquare Bid Adapter: add DSA support (#11070) * mediasquare Bid Adapter: add DSA support * mediasquare Bid Adapter: add DSA support * PBjs Core : add ability to inject tracking in video (#10191) * add vast impression tracking * support additional context macro * fix spaces and singlequotes * remove 2494945CONTEXT2494945 macro * remove CONTEXT macro * do not update vastImpUrl anymore * add impression trackers in video cache * insert ony unique trackers * rename registerVastTrackers * rename arrayVastTrackers * trackers object change * check modules are allowed to add trackers based on isActivityAllowed * rename validVastTracker and add line breaks * removes duplicates verification in isValidVastTracker * changes in wrapURI + typo fix * requested changes * update function trackersToMap * using Set in trackers map * changes suggested by dgirardi * changes suggested by dgirardi * Update test/spec/video_spec.js Co-authored-by: Karim Mourra <[email protected]> * add spaces --------- Co-authored-by: Karim Mourra <[email protected]> * Adform Bid Adapter: add DSA support (#11066) * Vidazoo Bid Adapter: Implement onBidWon (#11057) * Add 'onBidWon' function and 'nurl' handling to vidazooBidAdapter * Add 'onBidWon' function and 'nurl' handling to vidazooBidAdapter * This update introduces the 'onBidWon' function to the vidazooBidAdapter module, and enhances handling for the 'nurl' property. * Adquery Bid Adapter : IdSystem fix getId and decode method, added userSync with iframe type (#11019) * adquery/prebid_qid_work5 * adquery/prebid_qid_work4 * NextMillenium Bid Adapter : added support for the keywords parameter openrtb (#11018) * added support for gpp consent string * changed test for nextMillenniumBidAdapter * added some tests * added site.pagecat, site.content.cat and site.content.language to request * lint fix * formated code * formated code * formated code * pachage-lock with prebid * pachage-lock with prebid * formatted code * added device.sua, user.eids * formatted * fixed tests * fixed bug functio getSua * added support keywords * added support keywords - code style * changed test for otrb parameters * Contentexchange Bid Adapter: add gvlid (#11079) * add contentexchange bid adapter * fixes * fix * fix test * validate meta * fix * add GVLID * Prebid 8.35.0 release * Increment version to 8.36.0-pre * Core: fix missing AD_RENDER_SUCCEDED for outstream renderers (#11073) * IX Bid Adapter: support DSA fields [ADDR-2990] (#11069) Co-authored-by: Sajid Mahmood <[email protected]> * PBjs Core Utils: fix deepEqual() to work correctly on sites where Array.prototype has been extended (#11077) * Make utils.deepEqual() work correctly on sites where Array.prototype has been extended * Removed blank line * Marginal improvement --------- Co-authored-by: Demetrio Girardi <[email protected]> * Yieldlab Bid Adapter: Add Digital Services Act (DSA) handling (#10981) * YieldlabBidAdapter add Digital Services Act (DSA) handling for bid request and responses * YieldlabBidAdapter - read dsa from bidderRequest - put dsa response under meta.dsa not ext.dsa - handle multiple transparency objects under new parameter dsatransparency - only add query params if they are not undefined * Fixed build and improved docs (#11078) * Build system: add --no-lint-warnings option (#11082) * dsaControl module: Reject bids without meta.dsa when required (#10982) * dsaControl - reject bids without meta.dsa when required * ortbConverter: always set meta.dsa * dsaControl: reject bids whose DSA rendering method disagrees with the request * Prebid 8.36.0 release * Increment version to 8.37.0-pre * NoBid Analytics Adapter: added support for flag to control bidWon and auctionEnd independently. (#11087) * Enable supplyChain support * Added support for COPPA * rebuilt * Added support for Extended User IDs. * Added support for the "meta" attribute in bid response. * Delete nobidBidAdapter.js.orig * Delete a * Delete .jsdtscope * Delete org.eclipse.wst.jsdt.ui.superType.container * Delete org.eclipse.wst.jsdt.ui.superType.name * Delete .project * Added support for counting blocked requests for the Optimizer. * Added missing function for testing. * Added unit tests * Added support for Analytics adapter flag to control bidWon and auctionEnd independently. --------- Co-authored-by: Reda Guermas <[email protected]> * Microad Bid Adapter: send gpid and other to our request. (#11076) * Microad Bid Adapter: add gpid and other * Microad Bid Adapter: use deepAccess * Microad Bid Adapter: To simple existing check --------- Co-authored-by: kida-yuga <[email protected]> * StroeerCore Bid Adapter: add DSA support (#11083) * Teads adapter: add dsa info support in bid request & response (#11080) * Richaudience Bid Adapter : add compatibility to GPP (#11022) * RichaudienceBidAdapter add function onTimeout * Add unit test * revert: Revert changes in integrationExamples/creative.html * fix: Remove useless package in richaudiences test module * Change referer with host * Fix(RichaudienceBidAdapter): Change url tracking * deploy * change test * remove change others adapters * feat(RichaudienceBidAdapter): Add compatibility to GPP * fix(RichaudienceBidAdapter): Add test to GPP * fix(RichaudienceBidAdapter): Add test to GPP * fix(RichaudienceBidAdapter): Change tmax/timeout hardcoded #9787 --------- Co-authored-by: Sergi Gimenez <[email protected]> * add OpenX topics iframe (#11039) * ✨ add sellerCurrency to fledge auction config for criteo bid adapter (#11084) Co-authored-by: v.raybaud <[email protected]> * greenbids Analytics Adapter: fix double sampling bug (#11090) * greenbidsAnalyticsAdapter: fix double sampling bug * greenbidsAnalyticsAdapter bump version * mediasquare Bid Adapter: minor change with floors (#11100) * PAAPI/fledgeForGpt: make auction configs available independently from GPT (#10930) * paapi module * fledgeForGpt/paapi split and config aliases * Add reuse = false option and GPT slot reset * simpler log messages * fix reuse * refactory reset logic * remove reuse option, treat auction configs as single-use * do not do global reset if called with auction filter * at auction end autoconfig, reset all slots involved in the auction * includeBlanks * use includeBlanks from fledgeForGpt * Add Onetag topics iframe (#11091) Co-authored-by: onetag-dev <[email protected]> * Use built-in sampling (#11041) * Rubicon Bid Adapter: pass DSA fields (#10974) * Pass DSA fields through fastlane.json * adjusting field names to reflect IAB changes * adjust to new field names * Add DSA meta field for biiders * Add an unit test to handle DSA in response * Update the comments --------- Co-authored-by: bretg <[email protected]> * Fix build (#11098) * Lucead Bid Adapter: Add new adapter (#11068) * Add Whitebox adapter * Add Lucead Bid Adapter * update maintainer * update endpoint url * Adnuntius Bid Adapter: Allow user ID to be passed as parameter (#11029) * Removed linting issues * Fixed merge issues. * Bugfix on storageTool. * Change to pass user ID as a parameter to the adserver. * fetch user id from paraters comment. --------- Co-authored-by: Antonios Sarhanis <[email protected]> * Adagio Bid Adapter: add DSA support (#11096) * RTB House Bid Adapter: add DSA support (#11097) * RTB House adapter: add DSA support * RTB House: add DSA support with extended field control * The Moneytizer Bid Adapter: initial release (#11047) * Prebid 8.37.0 release * Increment version to 8.38.0-pre * ZetaGlobalSsp Analytics Adapter: keep only needed fields in event (#11107) * ZetaGlobalSspAnalyticsAdapter: keep only needed fields in event * - --------- Co-authored-by: Surovenko Alexey <[email protected]> Co-authored-by: Alexey Surovenko <[email protected]> * Add AdButler bid adapter (#11011) * define split between exploratory and non exploratory sides of the deterministic sampling hash (#11104) * Taboola Bid Adapter: fix cookie look up logic and gpp extracting (#11109) * cookie-look-up-logic-fix-gpp-fix * pass-version * add schain support (#11111) * Readpeak Bid Adapter : remove click url encoding (#11120) * Add banner support to readpeak bid adapter * Add onBidWon callback to trigger burl * Remove .only from test * Fix merge * Revert package-lock.json version update * Remove encoding of click target URL --------- Co-authored-by: Tuomo Tilli <[email protected]> Co-authored-by: readpeaktuomo <[email protected]> * fix handling of default settings for rubiconBidAdapter (#11114) Co-authored-by: Serhii Mozhaiskyi <[email protected]> * Zeta Global Ssp Adapter: remove null values from payload (#11092) * ZetaGlobalSsp: remove null values from payload * unit test --------- Co-authored-by: Surovenko Alexey <[email protected]> Co-authored-by: Alexey Surovenko <[email protected]> * Kimberlite Bidder Adapter: initial commit (#11032) * Kimberlite bid adapter (#1) * initial: bid adapter * styling * Fix: lint (#2) * Fix: lint (#4) * review fixes (#6) * Change: filling request.ext.prebid section (#7) --------- Co-authored-by: Oleg <[email protected]> * Pass TTD cookie through prebid endpoint (#11119) * Euid id module: cstg opt out enforcement (#11075) * initial technical implementation * initial technical implementation * test and doc update * optout check in encrypted payload * fixed cstg example config * Conversant Adapter: fix response handling (#11122) Co-authored-by: johwier <[email protected]> * Yieldmo Bid Adapter: send topics as string for request (#11121) * Convert topics to string * Update unit test * Bump ip from 1.1.8 to 1.1.9 (#11124) Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9. - [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Core: rendering logic overhaul, PUC-less native rendering (#10819) * Refactor rendering to go through a single code path * Build creative together with js * Fix pubUrl / pubDomain * Update dev tasks for creative building * Cross-domain render * Clean up empty fn * Autogenerated cross-domain creative example * Update text * Refactor creative * fix lint * Add test case for custom renderer * use URL instead of a tag * avoid using document.write * build creative together with bundle * direct rendering through display renderer * move mkFrame in base creative * do not share code between creative and core * lint cross-imports between creative and core * dynamic renderer in remote creative * remove support for non-messageChannel * take window instead of document in renderers * separate native rendering data from messaging logic * include native rendering data in response messages * move message rendering data into native rendering module * move video module render logic to video module * extract resize logic * extract native resizing & tracking messages * refactor creative renderers * WIP: native renderer * native rendering and messages * use results/rejections to emit ad render succeeded/failed * use offsetHeight, not clientHeight * refactor placeholder replacement logic * Fix firefox promises, add integ examples * update creative/README.md * fix integ examples * update README * native renderer: small size improvements * 33Across User ID sub-module: Introduce first-party ID support (#10714) * Introduce first-party ID support to 33Across User ID sub-module. Resolves IDG-1216. * Ensure first-party ID is removed for local storage in situations like GPP conssent change * 33Across User ID sub-module: Add cookie storage support for first-party ID, * 33Across User ID sub-module: Also remove first-party ID from cookie storage * remove duplicated 33across ID test * clear 33across ID from localstorage * Add configuration flag for 1PID * Suppress 33across ID requests where GDPR applies --------- Co-authored-by: Joshua Poritz <[email protected]> Co-authored-by: Carlos Felix <[email protected]> Co-authored-by: Aparna Rao <[email protected]> * New bidder adapter : RixEngine (#11035) * RixEngine Bid Adapter: Add RixEngine bid adapter * update rixengineBidAdapter_spec.js * remove the user ID opt in and provide a test endpoint --------- Co-authored-by: Yuanchang <[email protected]> * change expire recommendation from 90 to 30 (#11130) Co-authored-by: Anthony Lin <[email protected]> * add required version (#11127) * cleanup references to allowAuctionWithoutConsent (#11129) * fix video object null in validate request (#11128) * Reset Digital Bid Adapter: updating users syncs (#11126) * Update resetdigitalBidAdapter.js * updating usersync URL * fix user syncs for test * Alkimi Bid Adapter: add custom user object (#11093) * Alkimi bid adapter * Alkimi bid adapter * Alkimi bid adapter * alkimi adapter * onBidWon change * sign utils * auction ID as bid request ID * unit test fixes * change maintainer info * Updated the ad unit params * features support added * transfer adUnitCode * transfer adUnitCode: test * AlkimiBidAdapter getFloor() using * ALK-504 Multi size ad slot support * ALK-504 Multi size ad slot support * Support new OpenRTB parameters * Support new oRTB2 parameters * remove pos parameter * Add gvl_id into Alkimi adapter * Insert keywords into bid-request param * Resolve AUCTION_PRICE macro on prebid-server for VAST ads * Added support for full page auction * Added custom user object --------- Co-authored-by: Alexander <[email protected]> Co-authored-by: Alexander Bogdanov <[email protected]> Co-authored-by: Alexander Bogdanov <[email protected]> Co-authored-by: motors <[email protected]> Co-authored-by: mihanikw2g <[email protected]> Co-authored-by: Nikulin Mikhail <[email protected]> Co-authored-by: mik <[email protected]> * Unified ID 2.0 Module: Update documentation (#11105) * Update UID2 User ID submodule documentation - Link to guides on unifiedid.com - Replace references to "CSTG" with "client-side integration" - Split up params based on integration type - Link to unifiedid.com for normalization and encoding * Address UID2 documentation feedback * Fix uid2_pub_cookie and storage example values * Address review feedback * Restore deleted context about normalizing and encoding * Use a code block for sample token * Fix example for value * Address review feedback * Prebid 8.38.0 release * Increment version to 8.39.0-pre * GreenbidsAnalyticsAdapter: bump version following previous PR (#11135) * Rubicon Bid Adapter: Pass on carbon segtaxes (#10985) * Pass through Carbon segments * Fix rubiconBidAdapter for unit tests * segtax spec * Fix access issues * Remove dup ortb2 work * Adjust unit tests * Fix lint issues * Add all desired segtaxes * Fix unit tests * Fix linting * Don't concat undefined * Unit test pub added segtaxes * Pull site data from site.content.data * Update unit tests * Blockthrough Bid Adapter: initial release (#10870) * PE-87: Implement Prebid Adapter (#1) * PE-87: implement BT Bid Adapter * PE-87: rework adapter to use ortbConverter lib, make requested changes * PE-87: update imports * PE-110: Add user sync logic to the Prebid Adapter (#3) * PE-110: add user sync logic * PE-110: update userSync url * PE-110: check if iframe is enabled before setting params * PE-111: BT Prebid Adapter can request AA ads or regular ads (#2) * PE-120: Send Prebid Bidder info to BT Server (#4) * PE-120: add btBidderCode to the bid object * PE-120: use single quotes for logs string * PE-123: Add More Metadata in site.ext.blockthrough (#5) * PE-123: send additional meta data * PE-123: send auctionID under imp.ext.prebid.blockthrough * PE-123: use ortb2 config to set site.ext params * PE-123: sent auctionId in ext.prebid.blockthrough.auctionID * PE-123: update logs for bidderConfig setup * PE-000: check if blockthrough is defined (#6) * PE-87: remove BT specific logic (#7) * Implement Blockthrough Prebid Adapter * PE-87: Implement Prebid Adapter - misc fixes (#9) * PE-87: rename test file, add bidder config * PE-87: increase ttl * PE-000: fix test * BP-74: Change the way we enable debug (#10) * BP-79: Send GPID as a part of `imp[].ext` (#11) * BP-79: send gpid in imp.ext * BP-79: add optional operator * BP-90: Update Cookie Sync Logic (#12) * BP-90: pass bidder to cookie sync * BP-90: update sync logic, fix typo * BP-90: use const for syncs variable * BP-55: Re-add endpoint URLs (#13) * BP-91: Add prebid JS version to auction request (#14) * OMS Adapter: add new adapter (#10924) * OMS Adapter: add new adapter * OMS Adapter: fix tests * OMS Adapter: required changes * OMS Adapter: change ttl * OMS Adapter: required changes * zMaticoo Bid Adapter : add onBidWon function (#11056) * feat:add onBidWon function Signed-off-by: adam <L12354*。com> * bug:remove bidid and device required logic Signed-off-by: adam <L12354*。com> --------- Signed-off-by: adam <L12354*。com> Co-authored-by: adam <L12354*。com> * Criteo bid adapter: add fledge timeout and group limits (#11125) Set timeout to 50ms and 60 maximum interest groups per buyer * Reset Digital Bid Adapter: usersync url (#11138) * Updating image-based syncs url * minor config fix * Yandex: use ortb2 info & Core: add webdriver flag (#11110) * feat: add ortb2 types * feat: add ortb2 info to yandex * feat: add device.ext.webdriver to prebid core * fix: remove webdriver detection from yandex adapter * fix: adjust ortb2 types * Logicad Bid Adapter: Add paapi support (#11123) * Logicad Bid Adapter: Add paapi support * Logicad Bid Adapter: fix * Logicad Bid Adapter: fix test * Magnite Analytics: Check if prebid cache was called for video tracking (#10928) * add signal for client side cache * use Demetrio suggestion in magnite adapter instead * fix lint * test update * use weakset and remove once found * Demetrio knowledge transfer * Taboola Bid Adapter - support topics handling (#11139) * cookie-look-up-logic-fix-gpp-fix * Append support for topics in taboolaPrebidAdapter * test fix --------- Co-authored-by: ahmadlob <[email protected]> Co-authored-by: Ahmad Lobany <[email protected]> * Adagio Bid Adapter: fix ortb delivery video param validation (#11144) * JsDoc Lint Fix : multiple adapters and modules (#11103) * update jsdoc * add typedef * update typedef * fix typo * update jsdoc objectguard * fix colon issue * add typdef * fix rtdmodule doc * fix a few adapters * fix bid adapters * fix prisma * remove array syntax * fix adot * update jsdoc * update jsdoc colon * fix errors * fix params * fix jsdoc * add typedef * add typedef and fix * fix errors * import types * fix jsdoc warnings * fix warnings * add typedef * jsdoc fixes * jsdoc fixes * fix warnings * fix warnings * Mediaimpact Bid Adapter: initial release (#11099) * Add mediaimpact bid adapter * Add mediaimpact bid adapter tests --------- Co-authored-by: koshe <[email protected]> * Lucead Adapter: update (#11143) * Lucead Adapter: update * update endpoint url * update tests * ZetaGlobalSsp Bid Adapter: provide dspId into bid (#11150) Co-authored-by: Surovenko Alexey <[email protected]> Co-authored-by: Alexey Surovenko <[email protected]> * Adspirit Bid Adapter: initial release (#10939) * Add files via upload * Add files via upload * Update adspiritBidAdapter.js updated version with testcases * Update adspiritBidAdapter.md updated version add gdpr und privacy polices * testcases for adspirit adapter 1/2024 Added all the necessary test cases * Update adspiritBidAdapter_spec.js kicking off unit tests * kick of circleci * Update adspiritBidAdapter.js Bid Response is updated to outside of the condition with the shared values and here conditions only set the data that's specific to that use case * Update adspiritBidAdapter.md kicking off circleci ? --------- Co-authored-by: Patrick McCann <[email protected]> Co-authored-by: Chris Huie <[email protected]> * fix hadron ID module name (#11151) * Criteo bid adapter: raise Fledge timeout (#11152) Raise from 50ms to 500ms * Stn Bid Adapter: initial release (#11085) * stnBidAdapter: initial release * update endpoints * update stnBidAdapter * update the test mode params * Fixed use of adUnitId for analytics purpose (#11160) Co-authored-by: pm-azhar-mulla <[email protected]> * adspiritBidAdapter - fix lint errors in unit test file (#11163) * Prebid 8.39.0 release * Increment version to 8.40.0-pre * Opsco Bid Adapter : initial release (#11112) * Opsco bid adapter init commit * Opsco bid adapter banner implementation * Changing test parameter * Changing endpoint --------- Co-authored-by: adtech-sky <[email protected]> * ID5 User Id module - expose euid as a separate eid object (#11158) * Triplelift Bid Adapter: Optimize EID Signals (#11168) * MPY-77: Updated EID logic to ingest as is * MPY-77: Updated EID logic to ingest as is * Azerion Edge RTD Module: Initial release (#11134) * Azerion Edge RTD Module: Initial release ### Type of change [x] Feature: New RTD Submodule ### Description of change Adds new Azerion Edge RTD module. Maintainer: azerion.com Contact: @garciapuig @mserrate @gguridi * Azerion Edge RTD Module: Initial release. Typo * feat: pangle multi format (#11175) * NoBid Analytics Adapter: support for multiple currencies (#11171) * Enable supplyChain support * Added support for COPPA * rebuilt * Added support for Extended User IDs. * Added support for the "meta" attribute in bid response. * Delete nobidBidAdapter.js.orig * Delete a * Delete .jsdtscope * Delete org.eclipse.wst.jsdt.ui.superType.container * Delete org.eclipse.wst.jsdt.ui.superType.name * Delete .project * Added support for multiple currencies to the NoBid Analytics adapter. --------- Co-authored-by: Reda Guermas <[email protected]> * Fix for bids without userId specified. (#11170) * adstirBidAdapter support topic api (#11177) * inline ttd and refactor test (#11174) * NextMillennium Bid Adapter: removed the use of the events module (#11141) * added support for gpp consent string * changed test for nextMillenniumBidAdapter * added some tests * added site.pagecat, site.content.cat and site.content.language to request * lint fix * formated code * formated code * formated code * pachage-lock with prebid * pachage-lock with prebid * formatted code * added device.sua, user.eids * formatted * fixed tests * fixed bug functio getSua * deleted deprecated code wurl * removed the use of the events module * added parameters w and h for imp[].banner objecct * Colossus Bid Adapter: Add GPP Support and Accept eids from publisher request (#11155) * add video&native traffic colossus ssp * Native obj validation * Native obj validation #2 * Added size field in requests * fixed test * fix merge conflicts * move to 3.0 * move to 3.0 * fix IE11 new URL issue * fix IE11 new URL issue * fix IE11 new URL issue * https for 3.0 * add https test * add ccp and schain features * fix test * sync with upstream, fix conflicts * Update colossussspBidAdapter.js remove commented code * Update colossussspBidAdapter.js lint fix * identity extensions * identity extensions * fix * fix * fix * fix * fix * add tests for user ids * fix * fix * fix * fix * fix * fix * fix * add gdpr support * add gdpr support * id5id support * Update colossussspBidAdapter.js add bidfloor parameter * Update colossussspBidAdapter.js check bidfloor * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter_spec.js * use floor module * Revert "use floor module" This reverts commit f0c5c248627567e669d8eed4f2bb9a26a857e2ad. * use floor module * update to 5v * fix * add uid2 and bidFloor support * fix * add pbadslot support * fix conflicts * add onBidWon * refactor * add test for onBidWon() * fix * add group_id * Trigger circleci * fix * update user sync * fix window.location * fix test * updates * fix conflict * fix * updates * remove traffic param * add transactionId to request data for colossusssp adapter * Send tid in placements array * update user sync * updated tests * remove changes package-lock file * fix * add First Party Data * gpp support * accepting eids from request * fixing lint errors * resolving a conflict * fixing a failed test case related to tid * fixing karma version for conflict resolution * reverting package json files to original version --------- Co-authored-by: Vladislav Isaiko <[email protected]> Co-authored-by: Aiholkin <[email protected]> Co-authored-by: Bill Newman <[email protected]> Co-authored-by: Mykhailo Yaremchuk <[email protected]> Co-authored-by: kottapally <[email protected]> * Cwire adapter: Add gvl_id for tcfeu compliance  (c-wire/support#117) (#11181) * Vidazoo Bid Adapter : more ortb2 data and fledge support (#11182) * Pass ortb2 content data and user data to server. * Pass ortb2 content data and user data to server. * added fledge flag to to request * [JW Player RTD Module] Deprecate playerID (#11179) * renames player ID * updates tests * Delete test/spec/modules/enrichmentFpdModule_spec.js (#11188) * Prebid 8.40.0 release --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: adam <L12354*。com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: joseluis laso <[email protected]> Co-authored-by: Viktor Dreiling <[email protected]> Co-authored-by: AdmixerTech <[email protected]> Co-authored-by: Yaroslav Masenko <[email protected]> Co-authored-by: Olivier <[email protected]> Co-authored-by: redaguermas <[email protected]> Co-authored-by: Reda Guermas <[email protected]> Co-authored-by: Demetrio Girardi <[email protected]> Co-authored-by: ahmadlob <[email protected]> Co-authored-by: Nick Jacob <[email protected]> Co-authored-by: jackhsiehucf <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: Ryan Chou <[email protected]> Co-authored-by: ucfunne…
1 parent 17772ab commit 44de99e

File tree

555 files changed

+41081
-11261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

555 files changed

+41081
-11261
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ aliases:
77
- &environment
88
docker:
99
# specify the version you desire here
10-
- image: circleci/node:12.16.1-browsers
10+
- image: cimg/node:16.20-browsers
1111
resource_class: xlarge
1212
# Specify service dependencies here if necessary
1313
# CircleCI maintains a library of pre-built images

.eslintrc.js

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,25 @@ module.exports = {
1111
node: {
1212
moduleDirectory: ['node_modules', './']
1313
}
14+
},
15+
'jsdoc': {
16+
mode: 'typescript',
17+
tagNamePreference: {
18+
'tag constructor': 'constructor',
19+
extends: 'extends',
20+
method: 'method',
21+
return: 'return',
22+
}
1423
}
1524
},
16-
extends: 'standard',
25+
extends: [
26+
'standard',
27+
'plugin:jsdoc/recommended'
28+
],
1729
plugins: [
1830
'prebid',
19-
'import'
31+
'import',
32+
'jsdoc'
2033
],
2134
globals: {
2235
'BROWSERSTACK_USERNAME': false,
@@ -29,6 +42,7 @@ module.exports = {
2942
sourceType: 'module',
3043
ecmaVersion: 2018,
3144
},
45+
ignorePatterns: ['libraries/creative-renderer*'],
3246

3347
rules: {
3448
'comma-dangle': 'off',
@@ -46,6 +60,24 @@ module.exports = {
4660
'no-undef': 2,
4761
'no-useless-escape': 'off',
4862
'no-console': 'error',
63+
'jsdoc/check-types': 'off',
64+
'jsdoc/newline-after-description': 'off',
65+
'jsdoc/require-jsdoc': 'off',
66+
'jsdoc/require-param': 'off',
67+
'jsdoc/require-param-description': 'off',
68+
'jsdoc/require-param-name': 'off',
69+
'jsdoc/require-param-type': 'off',
70+
'jsdoc/require-property': 'off',
71+
'jsdoc/require-property-description': 'off',
72+
'jsdoc/require-property-name': 'off',
73+
'jsdoc/require-property-type': 'off',
74+
'jsdoc/require-returns': 'off',
75+
'jsdoc/require-returns-check': 'off',
76+
'jsdoc/require-returns-description': 'off',
77+
'jsdoc/require-returns-type': 'off',
78+
'jsdoc/require-yields': 'off',
79+
'jsdoc/require-yields-check': 'off',
80+
'jsdoc/tag-lines': 'off'
4981
},
5082
overrides: Object.keys(allowedModules).map((key) => ({
5183
files: key + '/**/*.js',

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
# Drafts your next Release notes as Pull Requests are merged into "master"
20-
- uses: release-drafter/release-drafter@v5
20+
- uses: release-drafter/release-drafter@v6
2121
with:
2222
config-name: release-drafter.yml
2323
env:

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ gulp test-coverage
255255
gulp view-coverage
256256
```
257257

258+
Local end-to-end testing can be done with:
259+
260+
```bash
261+
gulp e2e-test --local
262+
```
263+
258264
For Prebid.org members with access to BrowserStack, additional end-to-end testing can be done with:
259265

260266
```bash

allowedModules.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11

2-
const sharedWhiteList = [
3-
];
4-
52
module.exports = {
63
'modules': [
7-
...sharedWhiteList,
84
'criteo-direct-rsa-validate',
95
'crypto-js',
106
'live-connect' // Maintained by LiveIntent : https://github.com/liveintent-berlin/live-connect/
117
],
128
'src': [
13-
...sharedWhiteList,
149
'fun-hooks/no-eval',
1510
'just-clone',
1611
'dlv',
1712
'dset'
1813
],
1914
'libraries': [
20-
...sharedWhiteList // empty for now, but keep it to enable linting
15+
],
16+
'creative': [
2117
]
2218
};

creative/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Dynamic creative renderers
2+
3+
The contents of this directory are compiled separately from the rest of Prebid, and intended to be dynamically injected
4+
into creative frames:
5+
6+
- `crossDomain.js` (compiled into `build/creative/creative.js`, also exposed in `integrationExamples/gpt/x-domain/creative.html`)
7+
is the logic that should be statically set up in the creative.
8+
- At build time, each folder under 'renderers' is compiled into a source string made available from a corresponding
9+
`creative-renderer-*` library. These libraries are committed in source so that they are available to NPM consumers.
10+
- At render time, Prebid passes the appropriate renderer's source string to the remote creative, which then runs it.
11+
12+
The goal is to have a creative script that is as simple, lightweight, and unchanging as possible, but still allow the possibility
13+
of complex or frequently updated rendering logic. Compared to the approach taken by [PUC](https://github.com/prebid/prebid-universal-creative), this:
14+
15+
- should perform marginally better: the creative only runs logic that is pertinent (for example, it sees native logic only on native bids);
16+
- avoids the problem of synchronizing deployments when the rendering logic is updated (see https://github.com/prebid/prebid-universal-creative/issues/187), since it's bundled together with the rest of Prebid;
17+
- is easier to embed directly in the creative (saving a network call), since the static "shell" is designed to change as infrequently as possible;
18+
- allows the same rendering logic to be used both in remote (cross-domain) and local (`pbjs.renderAd`) frames, since it's directly available to Prebid;
19+
- requires Prebid.js - meaning it does not support AMP/App/Mobile (but it's still possible for something like PUC to run the same dynamic renderers
20+
when it receives them from Prebid, and fall back to separate AMP/App/Mobile logic otherwise).
21+
22+
### Renderer interface
23+
24+
A creative renderer (not related to other types of renderers in the codebase) is a script that exposes a global `window.render` function:
25+
26+
```javascript
27+
window.render = function(data, {mkFrame, sendMessage}, win) { ... }
28+
```
29+
30+
where:
31+
32+
- `data` is rendering data about the winning bid, and varies depending on the bid type - see `getRenderingData` in `adRendering.js`;
33+
- `mkFrame(document, attributes)` is a utility that creates a frame with the given attributes and convenient defaults (no border, margin, and scrolling);
34+
- `sendMessage(messageType, payload)` is the mechanism by which the renderer/creative can communicate back with Prebid - see `creativeMessageHandler` in `adRendering.js`;
35+
- `win` is the window to render into; note that this is not the same window that runs the renderer.
36+
37+
The function may return a promise; if it does and the promise rejects, or if the function throws, an AD_RENDER_FAILED event is emitted in Prebid. Otherwise an AD_RENDER_SUCCEEDED is fired
38+
when the promise resolves (or when `render` returns anything other than a promise).
39+
40+
### Renderer development
41+
42+
Since renderers are compiled into source, they use production settings even during development builds. You can toggle this with
43+
the `--creative-dev` CLI option (e.g., `gulp serve-fast --creative-dev`), which disables the minifier and generates source maps; if you do, take care
44+
to not commit the resulting `creative-renderer-*` libraries (or run a normal build before you do).

creative/constants.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// eslint-disable-next-line prebid/validate-imports
2+
import CONSTANTS from '../src/constants.json';
3+
4+
export const MESSAGE_REQUEST = CONSTANTS.MESSAGES.REQUEST;
5+
export const MESSAGE_RESPONSE = CONSTANTS.MESSAGES.RESPONSE;
6+
export const MESSAGE_EVENT = CONSTANTS.MESSAGES.EVENT;
7+
export const EVENT_AD_RENDER_FAILED = CONSTANTS.EVENTS.AD_RENDER_FAILED;
8+
export const EVENT_AD_RENDER_SUCCEEDED = CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED;
9+
export const ERROR_EXCEPTION = CONSTANTS.AD_RENDER_FAILED_REASON.EXCEPTION;

creative/crossDomain.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import {
2+
ERROR_EXCEPTION,
3+
EVENT_AD_RENDER_FAILED, EVENT_AD_RENDER_SUCCEEDED,
4+
MESSAGE_EVENT,
5+
MESSAGE_REQUEST,
6+
MESSAGE_RESPONSE
7+
} from './constants.js';
8+
9+
const mkFrame = (() => {
10+
const DEFAULTS = {
11+
frameBorder: 0,
12+
scrolling: 'no',
13+
marginHeight: 0,
14+
marginWidth: 0,
15+
topMargin: 0,
16+
leftMargin: 0,
17+
allowTransparency: 'true',
18+
};
19+
return (doc, attrs) => {
20+
const frame = doc.createElement('iframe');
21+
Object.entries(Object.assign({}, attrs, DEFAULTS))
22+
.forEach(([k, v]) => frame.setAttribute(k, v));
23+
return frame;
24+
};
25+
})();
26+
27+
export function renderer(win) {
28+
return function ({adId, pubUrl, clickUrl}) {
29+
const pubDomain = new URL(pubUrl, window.location).origin;
30+
31+
function sendMessage(type, payload, responseListener) {
32+
const channel = new MessageChannel();
33+
channel.port1.onmessage = guard(responseListener);
34+
win.parent.postMessage(JSON.stringify(Object.assign({message: type, adId}, payload)), pubDomain, [channel.port2]);
35+
}
36+
37+
function onError(e) {
38+
sendMessage(MESSAGE_EVENT, {
39+
event: EVENT_AD_RENDER_FAILED,
40+
info: {
41+
reason: e?.reason || ERROR_EXCEPTION,
42+
message: e?.message
43+
}
44+
});
45+
// eslint-disable-next-line no-console
46+
e?.stack && console.error(e);
47+
}
48+
49+
function guard(fn) {
50+
return function () {
51+
try {
52+
return fn.apply(this, arguments);
53+
} catch (e) {
54+
onError(e);
55+
}
56+
};
57+
}
58+
59+
function onMessage(ev) {
60+
let data;
61+
try {
62+
data = JSON.parse(ev.data);
63+
} catch (e) {
64+
return;
65+
}
66+
if (data.message === MESSAGE_RESPONSE && data.adId === adId) {
67+
const renderer = mkFrame(win.document, {
68+
width: 0,
69+
height: 0,
70+
style: 'display: none',
71+
srcdoc: `<script>${data.renderer}</script>`
72+
});
73+
renderer.onload = guard(function () {
74+
const W = renderer.contentWindow;
75+
// NOTE: on Firefox, `Promise.resolve(P)` or `new Promise((resolve) => resolve(P))`
76+
// does not appear to work if P comes from another frame
77+
W.Promise.resolve(W.render(data, {sendMessage, mkFrame}, win)).then(
78+
() => sendMessage(MESSAGE_EVENT, {event: EVENT_AD_RENDER_SUCCEEDED}),
79+
onError
80+
)
81+
});
82+
win.document.body.appendChild(renderer);
83+
}
84+
}
85+
86+
sendMessage(MESSAGE_REQUEST, {
87+
options: {clickUrl}
88+
}, onMessage);
89+
};
90+
}
91+
92+
window.pbRender = renderer(window);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// eslint-disable-next-line prebid/validate-imports
2+
import CONSTANTS from '../../../src/constants.json';
3+
4+
export const ERROR_NO_AD = CONSTANTS.AD_RENDER_FAILED_REASON.NO_AD;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {ERROR_NO_AD} from './constants.js';
2+
3+
export function render({ad, adUrl, width, height}, {mkFrame}, win) {
4+
if (!ad && !adUrl) {
5+
throw {
6+
reason: ERROR_NO_AD,
7+
message: 'Missing ad markup or URL'
8+
};
9+
} else {
10+
const doc = win.document;
11+
const attrs = {width, height};
12+
if (adUrl && !ad) {
13+
attrs.src = adUrl;
14+
} else {
15+
attrs.srcdoc = ad;
16+
}
17+
doc.body.appendChild(mkFrame(doc, attrs));
18+
}
19+
}
20+
21+
window.render = render;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// eslint-disable-next-line prebid/validate-imports
2+
import CONSTANTS from '../../../src/constants.json';
3+
4+
export const MESSAGE_NATIVE = CONSTANTS.MESSAGES.NATIVE;
5+
export const ACTION_RESIZE = 'resizeNativeHeight';
6+
export const ACTION_CLICK = 'click';
7+
export const ACTION_IMP = 'fireNativeImpressionTrackers';
8+
9+
export const ORTB_ASSETS = {
10+
title: 'text',
11+
data: 'value',
12+
img: 'url',
13+
video: 'vasttag'
14+
}

creative/renderers/native/renderer.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import {ACTION_CLICK, ACTION_IMP, ACTION_RESIZE, MESSAGE_NATIVE, ORTB_ASSETS} from './constants.js';
2+
3+
export function getReplacer(adId, {assets = [], ortb, nativeKeys = {}}) {
4+
const assetValues = Object.fromEntries((assets).map(({key, value}) => [key, value]));
5+
let repl = Object.fromEntries(
6+
Object.entries(nativeKeys).flatMap(([name, key]) => {
7+
const value = assetValues.hasOwnProperty(name) ? assetValues[name] : undefined;
8+
return [
9+
[`##${key}##`, value],
10+
[`${key}:${adId}`, value]
11+
];
12+
})
13+
);
14+
if (ortb) {
15+
Object.assign(repl,
16+
{
17+
'##hb_native_linkurl##': ortb.link?.url,
18+
'##hb_native_privacy##': ortb.privacy
19+
},
20+
Object.fromEntries(
21+
(ortb.assets || []).flatMap(asset => {
22+
const type = Object.keys(ORTB_ASSETS).find(type => asset[type]);
23+
return [
24+
type && [`##hb_native_asset_id_${asset.id}##`, asset[type][ORTB_ASSETS[type]]],
25+
asset.link?.url && [`##hb_native_asset_link_id_${asset.id}##`, asset.link.url]
26+
].filter(e => e);
27+
})
28+
)
29+
);
30+
}
31+
repl = Object.entries(repl).concat([[/##hb_native_asset_(link_)?id_\d+##/g]]);
32+
33+
return function (template) {
34+
return repl.reduce((text, [pattern, value]) => text.replaceAll(pattern, value || ''), template);
35+
};
36+
}
37+
38+
function loadScript(url, doc) {
39+
return new Promise((resolve, reject) => {
40+
const script = doc.createElement('script');
41+
script.onload = resolve;
42+
script.onerror = reject;
43+
script.src = url;
44+
doc.body.appendChild(script);
45+
});
46+
}
47+
48+
export function getAdMarkup(adId, nativeData, replacer, win, load = loadScript) {
49+
const {rendererUrl, assets, ortb, adTemplate} = nativeData;
50+
const doc = win.document;
51+
if (rendererUrl) {
52+
return load(rendererUrl, doc).then(() => {
53+
if (typeof win.renderAd !== 'function') {
54+
throw new Error(`Renderer from '${rendererUrl}' does not define renderAd()`);
55+
}
56+
const payload = assets || [];
57+
payload.ortb = ortb;
58+
return win.renderAd(payload);
59+
});
60+
} else {
61+
return Promise.resolve(replacer(adTemplate ?? doc.body.innerHTML));
62+
}
63+
}
64+
65+
export function render({adId, native}, {sendMessage}, win, getMarkup = getAdMarkup) {
66+
const {head, body} = win.document;
67+
const resize = () => sendMessage(MESSAGE_NATIVE, {
68+
action: ACTION_RESIZE,
69+
height: body.offsetHeight,
70+
width: body.offsetWidth
71+
});
72+
const replacer = getReplacer(adId, native);
73+
head && (head.innerHTML = replacer(head.innerHTML));
74+
return getMarkup(adId, native, replacer, win).then(markup => {
75+
body.innerHTML = markup;
76+
if (typeof win.postRenderAd === 'function') {
77+
win.postRenderAd({adId, ...native});
78+
}
79+
win.document.querySelectorAll('.pb-click').forEach(el => {
80+
const assetId = el.getAttribute('hb_native_asset_id');
81+
el.addEventListener('click', () => sendMessage(MESSAGE_NATIVE, {action: ACTION_CLICK, assetId}));
82+
});
83+
sendMessage(MESSAGE_NATIVE, {action: ACTION_IMP});
84+
win.document.readyState === 'complete' ? resize() : win.onload = resize;
85+
});
86+
}
87+
88+
window.render = render;

0 commit comments

Comments
 (0)