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 () {