diff --git a/integrationExamples/mass/index.html b/integrationExamples/mass/index.html deleted file mode 100644 index 3b034957d13..00000000000 --- a/integrationExamples/mass/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - -
-

Note: for this example to work, you need access to a bid simulation tool from your MASS enabled Exchange partner.

-
- -
-
- - diff --git a/modules/mass.js b/modules/mass.js deleted file mode 100644 index 113fdce8d4f..00000000000 --- a/modules/mass.js +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This module adds MASS support to Prebid.js. - */ - -import {config} from '../src/config.js'; -import {getHook} from '../src/hook.js'; -import {auctionManager} from '../src/auctionManager.js'; -import {timedBidResponseHook} from '../src/utils/perfMetrics.js'; - -const defaultCfg = { - dealIdPattern: /^MASS/i -}; -let cfg; - -export let listenerAdded = false; -export let isEnabled = false; - -const matchedBids = {}; -let renderers; - -config.getConfig('mass', config => init(config.mass)); - -/** - * Module init. - */ -export function init(userCfg) { - cfg = Object.assign({}, defaultCfg, window.massConfig && window.massConfig.mass, userCfg); - - if (cfg.enabled === false) { - if (isEnabled) { - getHook('addBidResponse').getHooks({hook: addBidResponseHook}).remove(); - isEnabled = false; - } - } else { - if (!isEnabled) { - getHook('addBidResponse').before(addBidResponseHook); - isEnabled = true; - } - } - - if (isEnabled) { - updateRenderers(); - } -} - -/** - * Update the list of renderers based on current config. - */ -export function updateRenderers() { - renderers = []; - - // official MASS renderer: - if (cfg.dealIdPattern && cfg.renderUrl) { - renderers.push({ - match: isMassBid, - render: useDefaultRender(cfg.renderUrl, 'mass') - }); - } - - // add any custom renderer defined in the config: - (cfg.custom || []).forEach(renderer => { - if (!renderer.match && renderer.dealIdPattern) { - renderer.match = useDefaultMatch(renderer.dealIdPattern); - } - - if (!renderer.render && renderer.renderUrl && renderer.namespace) { - renderer.render = useDefaultRender(renderer.renderUrl, renderer.namespace); - } - - if (renderer.match && renderer.render) { - renderers.push(renderer); - } - }); - - return renderers; -} - -/** - * Before hook for 'addBidResponse'. - */ -export const addBidResponseHook = timedBidResponseHook('mass', function addBidResponseHook(next, adUnitCode, bid, reject, {index = auctionManager.index} = {}) { - let renderer; - for (let i = 0; i < renderers.length; i++) { - if (renderers[i].match(bid)) { - renderer = renderers[i]; - break; - } - } - - if (renderer) { - const bidRequest = index.getBidRequest(bid); - - matchedBids[bid.requestId] = { - renderer, - payload: { - bidRequest, - bid, - adm: bid.ad - } - }; - - bid.ad = '