diff --git a/lib/pinf-loader-js/loader.js b/lib/pinf-loader-js/loader.js index 2831cba..272aa15 100644 --- a/lib/pinf-loader-js/loader.js +++ b/lib/pinf-loader-js/loader.js @@ -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) {