Skip to content
Draft
Changes from all 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
17 changes: 8 additions & 9 deletions JavaScriptResource.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -1463,15 +1463,14 @@ fiftyoneDegreesManager = function() {
}

// Loading the script twice replaces the first instance and its state. The
// Preference Management Platform adds this script only where the page's
// document carries no client script tag, and where a tag is there it waits
// for that tag to run, so that convenience never trips this warning and
// nobody should "fix" it to allow for it. The value is tested and not the
// property, because var {{_objName}} at the top level creates the global
// property with the value undefined before any statement runs, so testing
// the property would warn on every load. The text names the object and
// nothing else, because printing the existing object would print its
// payload, identifiers included.
// Preference Management Platform adds this script only where, once the
// page has loaded, no client script object is on it, so that convenience
// never trips this warning and nobody should "fix" it to allow for it.
// The value is tested and not the property, because var {{_objName}} at
// the top level creates the global property with the value undefined
// before any statement runs, so testing the property would warn on every
// load. The text names the object and nothing else, because printing the
// existing object would print its payload, identifiers included.
if (typeof window !== 'undefined' &&
typeof window["{{_objName}}"] !== 'undefined') {
console.warn("51Degrees: {{_objName}} already exists on this page. Loading the script twice replaces it. Load it once and call {{_objName}}.refresh() to update.");
Expand Down
Loading