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

Add Keen.noConflict to avoid version collisions #159

Closed
dustinlarimer opened this issue Sep 25, 2014 · 3 comments
Closed

Add Keen.noConflict to avoid version collisions #159

dustinlarimer opened this issue Sep 25, 2014 · 3 comments

Comments

@dustinlarimer
Copy link
Contributor

Something like this, added to src/core.js:

var preKeen = window.Keen;
var Keen = window.Keen = function(){};

// ...

Keen.noConflict = function(){
  window.Keen = preKeen;
  return this;
};

src/loader.js and src/async.js may need a little tweaking as well.

@dustinlarimer dustinlarimer changed the title Need a Keen.noConflict to avoid version collisions Add Keen.noConflict to avoid version collisions Sep 25, 2014
@bradvogel
Copy link

+1

@bradvogel
Copy link

This is also useful for adding Keen to a window where you don't control the global namespace. For example, a Chrome Extension injecting JS into another webpage's DOM.

@dustinlarimer
Copy link
Contributor Author

Released in v3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants