Skip to content

Commit

Permalink
better jetpack detection
Browse files Browse the repository at this point in the history
  • Loading branch information
cadorn committed Jan 31, 2012
1 parent 133d78b commit 2e4c6dd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/pinf-loader-js/loader.js
Expand Up @@ -47,15 +47,20 @@ var boot = exports.boot = function(options)
if (typeof window === "undefined" || typeof this.window === "undefined" || (""+this.window) === "undefined")
{
// We are running on a server or headless environment
if (typeof require !== "undefined")

if (typeof require !== "undefined")
{
// We are running on a CommonJS Modules environment

// Test for Jetpack
if (typeof __url__ !== "undefined" && typeof packaging !== "undefined" && typeof memory !== "undefined")
if (typeof memory !== "undefined")
{
adapter = "jetpack";
try {
if (typeof __platformName__ !== "undefined" && __platformName__ === "jetpack")
{
adapter = "jetpack";
}
} catch(e) {}
}
// Test for GPSEE
if (!adapter) {
Expand Down

0 comments on commit 2e4c6dd

Please sign in to comment.