Skip to content

Commit

Permalink
Prebid core: fix logic detecting if prebid is already loaded (#8549)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi authored Jun 9, 2022
1 parent 2eee11d commit ba28444
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bundle-template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Updated: <%= (new Date()).toISOString().substring(0, 10) %>
Modules: <%= modules %> */

if (!<%= prebid.globalVarName %> || !<%= prebid.globalVarName %>.libLoaded) {
if (!window.<%= prebid.globalVarName %> || !window.<%= prebid.globalVarName %>.libLoaded) {
$$PREBID_SOURCE$$
<% if(enable) {%>
<%= prebid.globalVarName %>.processQueue();
<% } %>
} else {
try {
if(<%= prebid.globalVarName %>.getConfig('debug')) {
if(window.<%= prebid.globalVarName %>.getConfig('debug')) {
console.warn('Attempted to load a copy of Prebid.js that clashes with the existing \'<%= prebid.globalVarName %>\' instance. Load aborted.');
}
} catch (e) {}
Expand Down

0 comments on commit ba28444

Please sign in to comment.