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

vpaid-html5-client

Package Overview
Dependencies
Maintainers
4
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.11 to 0.1.12

57

bin/VPAIDHTML5Client.js

@@ -522,8 +522,17 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

var utils = require('./utils');
var unique = utils.unique('vpaidIframe');
var VPAIDAdUnit = require('./VPAIDAdUnit');
var defaultTemplate = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n</head>\n<body>\n <script type=\"text/javascript\" src=\"{{iframeURL_JS}}\"></script>\n <script>\n parent.postMessage('{\"event\": \"ready\", \"id\": \"{{iframeID}}\"}', window.location.origin);\n </script>\n <div class=\"ad-element\">\n </div>\n</body>\n</html>\n";
var defaultTemplate = '<!DOCTYPE html>' +
'<html lang="en">' +
'<head><meta charset="UTF-8"></head>' +
'<body style="margin:0;padding:0"><div class="ad-element"></div>' +
'<script type="text/javascript" src="{{iframeURL_JS}}"></script>' +
'<script type="text/javascript">' +
'window.parent.postMessage(\'{"event": "ready", "id": "{{iframeID}}"}\', \'{{origin}}\');' +
'</script>' +
'</body>' +
'</html>';
var AD_STOPPED = 'AdStopped';

@@ -561,3 +570,2 @@

};
}

@@ -595,2 +603,3 @@

$unloadPreviousAdUnit.call(this);
var that = this;

@@ -602,5 +611,7 @@ var frame = utils.createIframeWithContent(

iframeURL_JS: adURL,
iframeID: this.getID()
iframeID: this.getID(),
origin: getOrigin()
}, this._templateConfig.extraOptions)
);
this._frame = frame;

@@ -619,10 +630,10 @@

//don't clear timeout
if (e.origin !== window.location.origin) return;
if (e.origin !== getOrigin()) return;
var result = JSON.parse(e.data);
//don't clear timeout
if (result.id !== this.getID()) return;
if (result.id !== that.getID()) return;
var adUnit, error, createAd;
if (!this._frame.contentWindow) {
if (!that._frame.contentWindow) {

@@ -632,3 +643,3 @@ error = 'the iframe is not anymore in the DOM tree';

} else {
createAd = this._frame.contentWindow.getVPAIDAd;
createAd = that._frame.contentWindow.getVPAIDAd;
error = utils.validate(typeof createAd === 'function', 'the ad didn\'t return a function to create an ad');

@@ -638,10 +649,10 @@ }

if (!error) {
var adEl = this._frame.contentWindow.document.querySelector('.ad-element');
adUnit = new VPAIDAdUnit(createAd(), adEl, this._videoEl, this._frame);
adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(this));
var adEl = that._frame.contentWindow.document.querySelector('.ad-element');
adUnit = new VPAIDAdUnit(createAd(), adEl, that._videoEl, that._frame);
adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(that));
error = utils.validate(adUnit.isValidVPAIDAd(), 'the add is not fully complaint with VPAID specification');
}
this._adUnit = adUnit;
$destroyLoadListener.call(this);
that._adUnit = adUnit;
$destroyLoadListener.call(that);
callback(error, error ? null : adUnit);

@@ -734,2 +745,13 @@

function getOrigin() {
if( window.location.origin ) {
return window.location.origin;
}
else {
return window.location.protocol + "//" +
window.location.hostname +
(window.location.port ? ':' + window.location.port: '');
}
}
module.exports = VPAIDHTML5Client;

@@ -885,2 +907,5 @@ window.VPAIDHTML5Client = VPAIDHTML5Client;

nEl.src = url || 'about:blank';
nEl.marginWidth = '0';
nEl.marginHeight = '0';
nEl.frameBorder = '0';
nEl.width = '100%';

@@ -891,2 +916,6 @@ nEl.height = '100%';

nEl.style.top = '0';
nEl.style.margin = '0px';
nEl.style.padding = '0px';
nEl.style.border = 'none';
nEl.setAttribute('SCROLLING','NO');
parent.innerHTML = '';

@@ -971,2 +1000,2 @@ parent.appendChild(nEl);

//# sourceMappingURL=VPAIDHTML5Client.js.map
//# sourceMappingURL=VPAIDHTML5Client.js.map
{
"name": "VPAIDHTML5Client",
"version": "0.1.11",
"version": "0.1.12",
"homepage": "https://github.com/MailOnline/VPAIDHTML5Client",

@@ -9,6 +9,3 @@ "authors": [

"description": "VPAID HTML5",
"main": [
"bin/VPAIDHTML5Client.js",
"bin/VPAIDHTML5Client.js.map"
],
"main": "src/VPAIDHTML5Client.js",
"keywords": [

@@ -15,0 +12,0 @@ "VPAID",

@@ -20,3 +20,3 @@ 'use strict';

//test
var karma = require('karma').server;
var KarmaServer = require('karma').Server;
var istanbul = require('browserify-istanbul');

@@ -46,3 +46,2 @@

build.transform('brfs'); // parse readFileSync and inline the content of that file, useful for templates
build.on('log', gutil.log); // output build logs to terminal

@@ -77,3 +76,3 @@ gulp.task(taskName, task);

gulp.task('test:ci', function (done) {
karma.start({
new KarmaServer({
configFile: __dirname + '/karma.conf.js',

@@ -84,3 +83,3 @@ reporters: ['spec', 'coverage'],

debug: true,
transform: ['brfs', istanbul()]
transform: [istanbul()]
},

@@ -106,17 +105,21 @@ coverageReporter: {

}
}, done);
}, function () {
done();
}).start();
});
gulp.task('test:deploy', function (done) {
karma.start({
new KarmaServer({
configFile: __dirname + '/karma.conf.js'
}, done);
}, function () {
done();
}).start();
});
gulp.task('test:dev', function (done) {
karma.start({
new KarmaServer({
configFile: __dirname + '/karma.conf.js'
}, function () {
done();
});
}).start();
});

@@ -123,0 +126,0 @@

@@ -98,2 +98,5 @@ 'use strict';

nEl.src = url || 'about:blank';
nEl.marginWidth = '0';
nEl.marginHeight = '0';
nEl.frameBorder = '0';
nEl.width = '100%';

@@ -104,2 +107,6 @@ nEl.height = '100%';

nEl.style.top = '0';
nEl.style.margin = '0px';
nEl.style.padding = '0px';
nEl.style.border = 'none';
nEl.setAttribute('SCROLLING','NO');
parent.innerHTML = '';

@@ -106,0 +113,0 @@ parent.appendChild(nEl);

'use strict';
var fs = require('fs');
var utils = require('./utils');
var unique = utils.unique('vpaidIframe');
var VPAIDAdUnit = require('./VPAIDAdUnit');
var defaultTemplate = fs.readFileSync(__dirname + '/iframe.template.html', 'utf8');
var defaultTemplate = '<!DOCTYPE html>' +
'<html lang="en">' +
'<head><meta charset="UTF-8"></head>' +
'<body style="margin:0;padding:0"><div class="ad-element"></div>' +
'<script type="text/javascript" src="{{iframeURL_JS}}"></script>' +
'<script type="text/javascript">' +
'window.parent.postMessage(\'{"event": "ready", "id": "{{iframeID}}"}\', \'{{origin}}\');' +
'</script>' +
'</body>' +
'</html>';
var AD_STOPPED = 'AdStopped';

@@ -41,3 +50,2 @@

};
}

@@ -75,2 +83,3 @@

$unloadPreviousAdUnit.call(this);
var that = this;

@@ -82,5 +91,7 @@ var frame = utils.createIframeWithContent(

iframeURL_JS: adURL,
iframeID: this.getID()
iframeID: this.getID(),
origin: getOrigin()
}, this._templateConfig.extraOptions)
);
this._frame = frame;

@@ -99,10 +110,10 @@

//don't clear timeout
if (e.origin !== window.location.origin) return;
if (e.origin !== getOrigin()) return;
var result = JSON.parse(e.data);
//don't clear timeout
if (result.id !== this.getID()) return;
if (result.id !== that.getID()) return;
var adUnit, error, createAd;
if (!this._frame.contentWindow) {
if (!that._frame.contentWindow) {

@@ -112,3 +123,3 @@ error = 'the iframe is not anymore in the DOM tree';

} else {
createAd = this._frame.contentWindow.getVPAIDAd;
createAd = that._frame.contentWindow.getVPAIDAd;
error = utils.validate(typeof createAd === 'function', 'the ad didn\'t return a function to create an ad');

@@ -118,10 +129,10 @@ }

if (!error) {
var adEl = this._frame.contentWindow.document.querySelector('.ad-element');
adUnit = new VPAIDAdUnit(createAd(), adEl, this._videoEl, this._frame);
adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(this));
var adEl = that._frame.contentWindow.document.querySelector('.ad-element');
adUnit = new VPAIDAdUnit(createAd(), adEl, that._videoEl, that._frame);
adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(that));
error = utils.validate(adUnit.isValidVPAIDAd(), 'the add is not fully complaint with VPAID specification');
}
this._adUnit = adUnit;
$destroyLoadListener.call(this);
that._adUnit = adUnit;
$destroyLoadListener.call(that);
callback(error, error ? null : adUnit);

@@ -214,4 +225,15 @@

function getOrigin() {
if( window.location.origin ) {
return window.location.origin;
}
else {
return window.location.protocol + "//" +
window.location.hostname +
(window.location.port ? ':' + window.location.port: '');
}
}
module.exports = VPAIDHTML5Client;
window.VPAIDHTML5Client = VPAIDHTML5Client;

@@ -27,3 +27,2 @@ module.exports = function (karma) {

debug: true,
transform: ['brfs']
},

@@ -30,0 +29,0 @@

{
"name": "vpaid-html5-client",
"version": "0.1.11",
"version": "0.1.12",
"description": "VPAID HTML5",
"main": [
"bin/VPAIDHTML5Client.js",
"bin/VPAIDHTML5Client.js.map"
],
"main": "src/VPAIDHTML5Client.js",
"scripts": {

@@ -32,6 +29,6 @@ "start": "gulp serve",

"homepage": "https://github.com/MailOnline/VPAIDHTML5Client",
"//": "locking karma version to 0.13.9 until socket.io patch is released to fix karma issue : https://github.com/karma-runner/karma/issues/1788",
"devDependencies": {
"brfs": "^1.4.0",
"browser-sync": "^2.7.6",
"browserify": "^10.2.4",
"browser-sync": "^2.11.1",
"browserify": "^13.0.0",
"browserify-istanbul": "^0.2.1",

@@ -43,13 +40,14 @@ "chai": "^3.0.0",

"gulp-util": "^3.0.5",
"karma": "^0.12.37",
"karma-browserify": "^4.2.1",
"karma": "0.13.9",
"karma-browserify": "^5.0.1",
"karma-chai-sinon": "^0.1.5",
"karma-chrome-launcher": "^0.1.12",
"karma-coverage": "^0.4.2",
"karma-chrome-launcher": "^0.2.2",
"karma-coverage": "^0.5.3",
"karma-firefox-launcher": "^0.1.6",
"karma-mocha": "^0.1.10",
"karma-mocha": "^0.2.1",
"karma-source-map-support": "^1.0.0",
"karma-spec-reporter": "0.0.19",
"lodash": "^3.9.3",
"karma-spec-reporter": "^0.0.23",
"lodash": "^4.0.1",
"mocha": "^2.2.5",
"mversion": "^1.10.1",
"sinon": "^1.14.1",

@@ -59,4 +57,4 @@ "sinon-chai": "^2.8.0",

"vinyl-source-stream": "^1.1.0",
"watchify": "^3.2.2"
"watchify": "^3.7.0"
}
}

@@ -6,3 +6,3 @@ //a fake vpaid ad only to pass the validation of IVPAIDAdUnit

return new IVPAIDAdUnit();
}
};

@@ -9,3 +9,3 @@ var IVPAIDAdUnit = require('../../js/IVPAIDAdUnit');

LinearAd.prototype[key] = function () {
}
};
});

@@ -34,3 +34,3 @@

func.apply(this, args.concat(arguments));
}
};
}

@@ -37,0 +37,0 @@

@@ -9,3 +9,3 @@ 'use strict';

var VPAIDHTML5Client = require('../../js/VPAIDHTML5Client');
var template = fs.readFileSync(__dirname + '/../fixtures/iframe.template.html', 'utf8');
var template = require('../testHelper').iframeTemplate;

@@ -39,3 +39,3 @@ describe('integration test', function () {

assert(onLoad.calledOnce);
assert.isNull(onLoad.getCall(0).args[0])
assert.isNull(onLoad.getCall(0).args[0]);
done();

@@ -116,3 +116,3 @@ });

adUnit.subscribe('AdStarted', function(msg) {
adUnit.resizeAd(300, 200, 'normal', callback)
adUnit.resizeAd(300, 200, 'normal', callback);
});

@@ -123,3 +123,3 @@ adUnit.startAd();

})
});
});

@@ -126,0 +126,0 @@

@@ -0,1 +1,3 @@

'use stirict';
module.exports.after = function after(count, handler) {

@@ -8,3 +10,3 @@ return function () {

};
}
};

@@ -16,3 +18,3 @@ module.exports.noop = function (){};

vpaid._frame.dispatchEvent(event);
}
};

@@ -47,3 +49,3 @@ module.exports.framePostMessage = function (data) {

});
}
};

@@ -56,1 +58,21 @@ module.exports.implementsProperties = function implements(creative, array) {

module.exports.iframeTemplate = '' +
'<!DOCTYPE html>' +
'<html lang="en">' +
'<head>' +
' <meta charset="UTF-8">' +
'</head>' +
'<body>' +
' <script>' +
' window.console = window.parent.console; // use parent console that have enhanced by test environment' +
' </script>' +
' <script type="text/javascript" src="{{browserify_JS}}"></script>' +
' <script type="text/javascript" src="{{iframeURL_JS}}"></script>' +
' <script>' +
' parent.postMessage(\'{"event": "ready", "id": "{{iframeID}}"}\', window.location.origin);' +
' </script>' +
' <div class="ad-element">' +
' </div>' +
'</body>' +
'</html>';

@@ -264,8 +264,6 @@ var noop = require('../testHelper').noop;

});
});
});
})
});

@@ -8,3 +8,3 @@ 'use strict';

var VPAIDHTML5Client = require('../../js/VPAIDHTML5Client');
var template = fs.readFileSync(__dirname + '/../fixtures/iframe.template.html', 'utf8');
var template = require('../testHelper').iframeTemplate;

@@ -11,0 +11,0 @@ describe('VPAIDHTML5Client.js api', function() {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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