Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Between Bid Adapter & Airgrid rtd module: fix support for ie11 #7619

Merged
merged 6 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/airgridRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function attachScriptTagToDOM(rtdConfig) {
edktInitializor.load = function(e) {
var p = e || 'sdk';
var n = document.createElement('script');
n.type = 'text/javascript';
n.type = 'module';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this forces this noncompatible script to not get called on old browsers

n.async = true;
n.src = 'https://cdn.edkt.io/' + p + '/edgekit.min.js';
document.getElementsByTagName('head')[0].appendChild(n);
Expand Down
3 changes: 2 additions & 1 deletion modules/betweenBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const BIDDER_CODE = 'between';
let ENDPOINT = 'https://ads.betweendigital.com/adjson?t=prebid';
const CODE_TYPES = ['inpage', 'preroll', 'midroll', 'postroll'];

const includes = require('core-js-pure/features/array/includes.js');
export const spec = {
code: BIDDER_CODE,
aliases: ['btw'],
Expand Down Expand Up @@ -53,7 +54,7 @@ export const spec = {
params.mind = video.mind;
params.pos = 'atf';
ENDPOINT += '&jst=pvc';
params.codeType = CODE_TYPES.includes(video.codeType) ? video.codeType : 'inpage';
params.codeType = includes(CODE_TYPES, video.codeType) ? video.codeType : 'inpage';
}

if (i.params.itu !== undefined) {
Expand Down
13 changes: 7 additions & 6 deletions modules/yahoosspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { deepAccess, isFn, isStr, isNumber, isArray, isEmpty, isPlainObject, gen
import { config } from '../src/config.js';
import { Renderer } from '../src/Renderer.js';

const includes = require('core-js-pure/features/array/includes.js');
const INTEGRATION_METHOD = 'prebid.js';
const BIDDER_CODE = 'yahoossp';
const ADAPTER_VERSION = '1.0.1';
Expand Down Expand Up @@ -144,9 +145,9 @@ function getAdapterMode() {

function getResponseFormat(bid) {
const adm = bid.adm;
if (adm.includes('o2playerSettings') || adm.includes('YAHOO.VideoPlatform.VideoPlayer') || adm.includes('AdPlacement')) {
if (includes(adm, 'o2playerSettings') || includes(adm, 'YAHOO.VideoPlatform.VideoPlayer') || includes(adm, 'AdPlacement')) {
return BANNER;
} else if (adm.includes('VAST')) {
} else if (includes(adm, 'VAST')) {
return VIDEO;
}
};
Expand Down Expand Up @@ -188,23 +189,23 @@ function validateAppendObject(validationType, allowedKeys, inputObject, appendTo
for (const objectKey in inputObject) {
switch (validationType) {
case 'string':
if (allowedKeys.includes(objectKey) && isStr(inputObject[objectKey])) {
if (includes(allowedKeys, objectKey) && isStr(inputObject[objectKey])) {
outputObject[objectKey] = inputObject[objectKey];
};
break;
case 'number':
if (allowedKeys.includes(objectKey) && isNumber(inputObject[objectKey])) {
if (includes(allowedKeys, objectKey) && isNumber(inputObject[objectKey])) {
outputObject[objectKey] = inputObject[objectKey];
};
break;

case 'array':
if (allowedKeys.includes(objectKey) && isArray(inputObject[objectKey])) {
if (includes(allowedKeys, objectKey) && isArray(inputObject[objectKey])) {
outputObject[objectKey] = inputObject[objectKey];
};
break;
case 'object':
if (allowedKeys.includes(objectKey) && isPlainObject(inputObject[objectKey])) {
if (includes(allowedKeys, objectKey) && isPlainObject(inputObject[objectKey])) {
outputObject[objectKey] = inputObject[objectKey];
};
break;
Expand Down
3 changes: 2 additions & 1 deletion test/spec/unit/core/adapterManager_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ describe('adapterManager tests', function () {
});

it('should call spec\'s onBidderError callback when callBidderError is called', function () {
const bidderRequest = getBidRequests().find(bidRequest => bidRequest.bidderCode === bidder);
const bidRequests = getBidRequests();
const bidderRequest = find(bidRequests, bidRequest => bidRequest.bidderCode === bidder);
const xhrErrorMock = {
status: 500,
statusText: 'Internal Server Error'
Expand Down