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

Various files: clean up unneeded code #8778

Merged
merged 27 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b90e885
Update example2.js
patmmccann Aug 3, 2022
80be5d3
Update example.js
patmmccann Aug 3, 2022
3bdc647
Update config.js
patmmccann Aug 3, 2022
25c774f
Update freewheel-sspBidAdapter.js
patmmccann Aug 3, 2022
b1aee69
Update browsiRtdProvider.js
patmmccann Aug 3, 2022
b4b27ea
Update consentManagementUsp.js
patmmccann Aug 3, 2022
d326046
Update synacormediaBidAdapter.js
patmmccann Aug 3, 2022
f8caf50
Update trustpidSystem.js
patmmccann Aug 3, 2022
f5c5804
Update tappxBidAdapter.js
patmmccann Aug 3, 2022
8a2d62a
Update nobidBidAdapter.js
patmmccann Aug 3, 2022
42ec684
Update visxBidAdapter.js
patmmccann Aug 3, 2022
d5a882f
Update remote.html
patmmccann Aug 3, 2022
b7c5ae5
Update prebidServer_example.html
patmmccann Aug 3, 2022
959b617
Update openxBidAdapter.js
patmmccann Aug 4, 2022
04f9d8c
Update fintezaAnalyticsAdapter.js
patmmccann Aug 4, 2022
e73f6c2
Update postbid-config.js
patmmccann Aug 4, 2022
f2e20ec
Update postbid-config.js
patmmccann Aug 4, 2022
668aeb2
Update fintezaAnalyticsAdapter.js
patmmccann Aug 4, 2022
6828a01
Update 1plusXRtdProviderExample.html
patmmccann Aug 4, 2022
039725c
Update prebidServer_example.html
patmmccann Aug 4, 2022
1ddba68
Update blueconicRtdProvider_example.html
patmmccann Aug 4, 2022
66fe01b
Update hadronRtdProvider_example.html
patmmccann Aug 4, 2022
46dd370
Update airgridRtdProvider_example.html
patmmccann Aug 4, 2022
fce06cc
Update userId_example.html
patmmccann Aug 4, 2022
8428815
Update inskin_example.html
patmmccann Aug 4, 2022
3d39022
Update serverbidServer_example.html
patmmccann Aug 4, 2022
ab40b2b
Update postbid-config.js
patmmccann Aug 4, 2022
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
6 changes: 2 additions & 4 deletions integrationExamples/gpt/1plusXRtdProviderExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//securepubads.g.doubleclick.net/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand All @@ -109,4 +107,4 @@ <h2>1plusX RTD Module for Prebid</h2>
</div>
</body>

</html>
</html>
5 changes: 1 addition & 4 deletions integrationExamples/gpt/airgridRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@
var gads = document.createElement("script");
gads.async = true;
gads.type = "text/javascript";
var useSSL = "https:" == document.location.protocol;
gads.src =
(useSSL ? "https:" : "http:") +
"//www.googletagservices.com/tag/js/gpt.js";
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName("script")[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
2 changes: 1 addition & 1 deletion integrationExamples/gpt/amp/remote.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

// load Prebid.js
(function () {
var d = document, pbs = d.createElement("script"), pro = d.location.protocal;
var d = document, pbs = d.createElement("script");
pbs.type = "text/javascript";
pbs.src = prebidSrc;
var target = document.getElementsByTagName("head")[0];
Expand Down
6 changes: 2 additions & 4 deletions integrationExamples/gpt/blueconicRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
</script>
<script src="//cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js" async></script>
<script src="https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js" async></script>

<script>
var googletag = googletag || {};
Expand Down Expand Up @@ -88,9 +88,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//securepubads.g.doubleclick.net/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/hadronRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/inskin_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/prebidServer_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/serverbidServer_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/userId_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
10 changes: 5 additions & 5 deletions integrationExamples/postbid/oas/postbid-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

(function() {
var pbjsEl = document.createElement("script"); pbjsEl.type = "text/javascript";
pbjsEl.async = true; var isHttps = 'https:' === document.location.protocol;
pbjsEl.src = (isHttps ? "https" : "http") + "://acdn.adnxs.com/prebid/not-for-prod/prebid.js";
var pbjsTargetEl = document.getElementsByTagName("head")[0];
var pbjsEl = document.createElement('script'); pbjsEl.type = 'text/javascript';
pbjsEl.async = true;
pbjsEl.src = 'https://acdn.adnxs.com/prebid/not-for-prod/prebid.js'
var pbjsTargetEl = document.getElementsByTagName('head')[0];
pbjsTargetEl.insertBefore(pbjsEl, pbjsTargetEl.firstChild);
})();

Expand Down Expand Up @@ -51,4 +51,4 @@ pbjs.que.push(function() {
});
});
</script>
<iframe id='postbid_if_3' FRAMEBORDER="0" SCROLLING="no" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" LEFTMARGIN="0" ALLOWTRANSPARENCY="true" WIDTH="0" HEIGHT="0"></iframe>
<iframe id='postbid_if_3' FRAMEBORDER="0" SCROLLING="no" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" LEFTMARGIN="0" ALLOWTRANSPARENCY="true" WIDTH="0" HEIGHT="0"></iframe>
4 changes: 2 additions & 2 deletions libraries/analyticsAdapter/examples/libraries/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ events.init();
// overwrite example object and handle 'on' callbacks
window[window.ExampleAnalyticsGlobalObject] = example = utils.errorless(function() {
if (arguments[0] && arguments[0] === 'on') {
var eventName = arguments[1] && arguments[1];
var args = arguments[2] && arguments[2];
var eventName = arguments[1];
var args = arguments[2];
if (eventName && args) {
if (eventName === 'bidAdjustment') {
pbjsHandlers.onBidAdjustment.apply(this, [args]);
Expand Down
4 changes: 2 additions & 2 deletions libraries/analyticsAdapter/examples/libraries/example2.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ events.init();
// overwrite example object and handle 'on' callbacks
window[window.ExampleAnalyticsGlobalObject2] = example = utils.errorless(function() {
if (arguments[0] && arguments[0] === 'on') {
var eventName = arguments[1] && arguments[1];
var args = arguments[2] && arguments[2];
var eventName = arguments[1];
var args = arguments[2];
if (eventName && args) {
if (eventName === 'bidAdjustment') {
pbjsHandlers.onBidAdjustment.apply(this, [args]);
Expand Down
4 changes: 2 additions & 2 deletions modules/browsiRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function collectData() {
function waitForData(callback) {
if (_browsiData) {
_dataReadyCallback = null;
callback(_browsiData);
callback();
} else {
_dataReadyCallback = callback;
}
Expand All @@ -102,7 +102,7 @@ function waitForData(callback) {
export function setData(data) {
_browsiData = data;
if (isFn(_dataReadyCallback)) {
_dataReadyCallback(_browsiData);
_dataReadyCallback();
_dataReadyCallback = null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/consentManagementUsp.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function lookupUspConsent({onSuccess, onError}) {
let uspapiFrame;
let uspapiFunction;

while (!uspapiFrame) {
while (true) {
try {
if (typeof f.__uspapi === 'function') {
uspapiFunction = f.__uspapi;
Expand Down
2 changes: 1 addition & 1 deletion modules/fintezaAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function initSession() {
!checkSessionByExpires() ||
!checkSessionByReferer() ||
!checkSessionByDay()) {
sessionId = '' + timestamp + getRandAsStr(SESSION_RAND_PART);
sessionId = '' + timestamp + getRandAsStr(SESSION_RAND_PART); // lgtm [js/insecure-randomness]
begin = timestamp;

isNew = true;
Expand Down
2 changes: 1 addition & 1 deletion modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function formatAdHTML(bid, size) {
var libUrl = '';
if (integrationType && integrationType !== 'inbanner') {
libUrl = PRIMETIME_URL + getComponentId(bid.params.format) + '.min.js';
script = getOutstreamScript(bid, size);
script = getOutstreamScript(bid);
} else {
libUrl = MUSTANG_URL;
script = getInBannerScript(bid, size);
Expand Down
2 changes: 1 addition & 1 deletion modules/nobidBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function nobidBuildRequests(bids, bidderRequest) {
var serializeState = function(divIds, siteId, adunits) {
var filterAdUnitsByIds = function(divIds, adUnits) {
var filtered = [];
if (!divIds || !divIds.length) {
if (!divIds.length) {
filtered = adUnits;
} else if (adUnits) {
var a = [];
Expand Down
2 changes: 0 additions & 2 deletions modules/openxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,11 @@ function getViewportDimensions(isIfr) {
} catch (e) {
return;
}
docEl = tDoc.documentElement;
body = tDoc.body;

width = tWin.innerWidth || docEl.clientWidth || body.clientWidth;
height = tWin.innerHeight || docEl.clientHeight || body.clientHeight;
} else {
docEl = tDoc.documentElement;
width = tWin.innerWidth || docEl.clientWidth;
height = tWin.innerHeight || docEl.clientHeight;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/synacormediaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const spec = {
});

// CCPA
if (bidderRequest && bidderRequest.uspConsent) {
if (bidderRequest.uspConsent) {
deepSetValue(openRtbBidRequest, 'regs.ext.us_privacy', bidderRequest.uspConsent);
}

Expand Down
4 changes: 2 additions & 2 deletions modules/tappxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ function buildOneRequest(validBidRequests, bidderRequest) {
(typeof uuid !== 'undefined' && uuid !== null) &&
(typeof uuid.source == 'string' && uuid.source !== null) &&
(typeof uuid.uids[0].id == 'string' && uuid.uids[0].id !== null)
)
);

if (typeof user !== 'undefined') { user.ext.eids = eidsArr }
user.ext.eids = eidsArr;
};

let regs = {};
Expand Down
2 changes: 1 addition & 1 deletion modules/trustpidSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function getTrustpidFromStorage() {
logInfo(`${LOG_PREFIX}: Domain acronym found: ${acronym}`);

// Domain is correct in both local storage and idGraph, but no acronym is existing for the domain
if (domain && !acronym) {
if (!acronym) {
return {
trustpid: null,
acr: null
Expand Down
2 changes: 1 addition & 1 deletion modules/visxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ function _isAdSlotExists(adUnitCode) {
}

const gptAdSlot = getGptSlotInfoForAdUnitCode(adUnitCode);
if (gptAdSlot && gptAdSlot.divId && document.getElementById(gptAdSlot.divId)) {
if (gptAdSlot.divId && document.getElementById(gptAdSlot.divId)) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export function newConfig() {
}

const mergedConfig = Object.keys(obj).reduce((accum, key) => {
const prevConf = _getConfig(key)[key] || {};
const prevConf = _getConfig()[key] || {};
accum[key] = mergeDeep(prevConf, obj[key]);
return accum;
}, {});
Expand Down