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

vpaid-html5-client

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vpaid-html5-client - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

2

bower.json
{
"name": "VPAIDHTML5Client",
"version": "0.1.9",
"version": "0.1.10",
"homepage": "https://github.com/MailOnline/VPAIDHTML5Client",

@@ -5,0 +5,0 @@ "authors": [

@@ -196,2 +196,14 @@ 'use strict';

this._creative.subscribe($clickThruHook.bind(this), AD_CLICK);
// because we are adding the element inside the iframe
// the user is not able to click in the video
if (this._videoEl) {
var documentElement = this._iframe.contentDocument.documentElement;
var videoEl = this._videoEl;
documentElement.addEventListener('click', function(e) {
if (e.target === documentElement) {
videoEl.click();
}
});
}
}

@@ -198,0 +210,0 @@

{
"name": "vpaid-html5-client",
"version": "0.1.9",
"version": "0.1.10",
"description": "VPAID HTML5",

@@ -5,0 +5,0 @@ "main": [

@@ -33,5 +33,7 @@ var noop = require('../testHelper').noop;

var clock;
var clock, iframe;
beforeEach(function () {
clock = sinon.useFakeTimers();
iframe = document.createElement('iframe');
document.body.appendChild(iframe);
});

@@ -41,2 +43,3 @@

clock.restore();
document.body.removeChild(iframe);
});

@@ -67,2 +70,3 @@

var video = document.createElement('video');
iframe.contentDocument.body.appendChild(el);

@@ -73,3 +77,3 @@ var creative = new IVPAIDAdUnit();

new VPAIDAdUnit(creative, el, video).initAd(200, 200, 'normal', -1, {}, {videoSlotCanAutoPlay: true}, callback);
new VPAIDAdUnit(creative, el, video, iframe).initAd(200, 200, 'normal', -1, {}, {videoSlotCanAutoPlay: true}, callback);
new VPAIDAdUnit(creative).initAd(200, 200, 'normal', -1, {}, {slot: el, videoSlot: video, videoSlotCanAutoPlay: true}, callback);

@@ -83,2 +87,18 @@ clock.tick(1);

it('must add event listerner to iframe html element', function() {
var el = document.createElement('div');
var video = document.createElement('video');
iframe.contentDocument.body.appendChild(el);
var creative = new IVPAIDAdUnit();
var callback = sinon.spy();
new VPAIDAdUnit(creative, el, video, iframe).initAd(200, 200, 'normal', -1, {}, {videoSlotCanAutoPlay: true}, noop);
video.addEventListener('click', callback);
iframe.contentDocument.documentElement.click();
assert(callback.called, 'must trigger click in videoEl synchronous');
});
it('must subscribe to all events', function() {

@@ -168,3 +188,2 @@ var creative = new IVPAIDAdUnit();

});
});

@@ -171,0 +190,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