From f1c79727e3f6580767539498ffb735bb7809ec6c Mon Sep 17 00:00:00 2001 From: Matt Kendall <1870166+mkendall07@users.noreply.github.com> Date: Wed, 20 Nov 2019 13:44:25 -0500 Subject: [PATCH] Added _pbjsGlobals for tracking renames. Resolves #4254 (#4419) --- src/prebidGlobal.js | 4 ++++ test/spec/api_spec.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/prebidGlobal.js b/src/prebidGlobal.js index ec685236468..5eed4b3670f 100644 --- a/src/prebidGlobal.js +++ b/src/prebidGlobal.js @@ -4,6 +4,10 @@ window.$$PREBID_GLOBAL$$ = (window.$$PREBID_GLOBAL$$ || {}); window.$$PREBID_GLOBAL$$.cmd = window.$$PREBID_GLOBAL$$.cmd || []; window.$$PREBID_GLOBAL$$.que = window.$$PREBID_GLOBAL$$.que || []; +// create a pbjs global pointer +window._pbjsGlobals = window._pbjsGlobals || []; +window._pbjsGlobals.push('$$PREBID_GLOBAL$$'); + export function getGlobal() { return window.$$PREBID_GLOBAL$$; } diff --git a/test/spec/api_spec.js b/test/spec/api_spec.js index a8987d3ed07..6f21eba7aaf 100755 --- a/test/spec/api_spec.js +++ b/test/spec/api_spec.js @@ -24,6 +24,10 @@ describe('Publisher API', function () { it('should have $$PREBID_GLOBAL$$.que.push function', function () { assert.isFunction($$PREBID_GLOBAL$$.que.push); }); + + it('should have global pointer for PBJS global', function () { + assert.isArray(window._pbjsGlobals); + }); }); describe('has function', function () {