Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@financial-times/ads-display

Package Overview
Dependencies
Maintainers
18
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/ads-display - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

__mocks__/@financial-times/ads-permutive.js

65

dist/client.js

@@ -1,7 +0,8 @@

import oTracking from '@financial-times/o-tracking/dist/javascript/core.js';
import oTracking from '@financial-times/o-tracking';
import oAds from '@financial-times/ads-legacy-o-ads';
import { broadcast } from '@financial-times/n-tracking';
import { getUsPrivacyForTracking, setUSPrivacy } from '@financial-times/privacy-us-privacy';
import adsPermutive from '@financial-times/ads-permutive/src/client';
export { default as adsPermutive } from '@financial-times/ads-permutive/src/client';
import moatIntegration from '@financial-times/ads-moat-integration';
import adsPermutive from '@financial-times/ads-permutive';
export { default as adsPermutive } from '@financial-times/ads-permutive';

@@ -532,4 +533,3 @@ /**

if (options.waitForMoat) {
return waitForMoat(1000)
.finally(() => displayAds.initAdSlots(oAdsInstance))
moatIntegration();
}

@@ -687,53 +687,2 @@

/**
* Add the moat script to the page. This will add an extra targeting
* parameter to the ad call `m_data`. This will be 0 if the traffic
* is deemed valid, 1 if not. It will also be `waiting` if the ad request
* is sent before the moat script has had a chance to set `m_data`. It's a
* race between moat script and gpt script to send ad request, so first ad
* may not always have the `m_data` param to check for invalid traffic
*/
function validateTraffic(deferScript = true, cb = () => null) {
const existingScript = document.getElementById('n-ads-moat');
if (existingScript) {
return
}
const script = document.createElement('script');
script.defer = deferScript;
script.src = 'https://sejs.moatads.com/financialtimesprebidheader859796398452/yi.js';
script.id = 'n-ads-moat';
script.onload = () => {
perfMark('oAds.IVTComplete');
cb();
};
script.onerror = () => {
perfMark('oAds.IVTComplete');
cb();
};
document.head.appendChild(script);
}
function waitForMoat (timeout) {
return new Promise((resolve, reject) => {
const checkMoatInterval = setInterval(() => {
if(window.moatPrebidApi &&
typeof window.moatPrebidApi.slotDataAvailable === "function" &&
window.moatPrebidApi.slotDataAvailable() &&
window.moatPrebidApi.safetyDataAvailable()
) {
window.moatPrebidApi.setMoatTargetingForAllSlots();
clearInterval(checkMoatInterval);
clearTimeout(timeoutId);
resolve();
}
}, 50);
const timeoutId = setTimeout(() => {
clearInterval(checkMoatInterval);
reject();
}, timeout);
});
}
// Necessary for testing

@@ -747,5 +696,3 @@ const displayAds = {

getGptSite,
getGptZone,
validateTraffic,
waitForMoat
getGptZone
};

@@ -752,0 +699,0 @@

{
"name": "@financial-times/ads-display",
"version": "2.1.0",
"version": "2.2.0",
"description": "Bring ads to your page with the FT specific o-ads configuration",

@@ -40,7 +40,8 @@ "browser": "dist/client.js",

"dependencies": {
"@financial-times/ads-permutive": "^2.1.0",
"@financial-times/n-tracking": "1.4.0",
"@financial-times/ads-legacy-o-ads": "^2.1.0",
"@financial-times/o-tracking": "^2.0.3",
"@financial-times/privacy-us-privacy": "^1.0.0"
"@financial-times/ads-legacy-o-ads": "^2.2.0",
"@financial-times/ads-permutive": "^2.2.0",
"@financial-times/n-tracking": "4.0.0",
"@financial-times/o-tracking": "^4.0.0",
"@financial-times/privacy-us-privacy": "^1.0.0",
"@financial-times/ads-moat-integration": "^2.2.0"
},

@@ -51,2 +52,3 @@ "devDependencies": {

"@babel/preset-env": "^7.4.5",
"browser-resolve": "^2.0.0",
"eslint": "^7.0.0",

@@ -57,2 +59,3 @@ "eslint-import-resolver-webpack": "^0.13.0",

"jest": "^26.0.0",
"jest-environment-jsdom-global": "^2.0.4",
"jest-fetch-mock": "^3.0.3",

@@ -59,0 +62,0 @@ "lint-staged": "^10.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc