Skip to content

Instantly share code, notes, and snippets.

@triceam
Created Jan 28, 2013
Embed
What would you like to do?
Detecting PhoneGap/Ripple emulator via JavaScript
myFunction( param ) {
var emulated = window.tinyHippos != undefined;
if ( emulated ){
//do something specific to emulated environment;
return;
}
///do something else...
}
@jerone
Copy link

jerone commented Jan 28, 2013

I used this for older versions:

// check if we are in Ripple Emulator;
var emulated = !!document.getElementById("tinyhippos-injected") && !!window.top.require;

@sgrebnov
Copy link

sgrebnov commented Jun 25, 2014

I think the following code could be used as well

var emulated = window.parent && window.parent.ripple;

@slorber
Copy link

slorber commented Oct 23, 2014

thanks it works fine :) sgrebnov

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