Skip to content

Instantly share code, notes, and snippets.

@fgalassi
Created November 7, 2012 10:19
Show Gist options
  • Save fgalassi/4030727 to your computer and use it in GitHub Desktop.
Save fgalassi/4030727 to your computer and use it in GitHub Desktop.
Browser.prototype.isGradeA = function() {
var browser = this
browser.on("response", function(res, target) {
var window = browser.window
var document = browser.document
var onMobileInitMakeGradeA = function() {
if (window.$) {
window.$(document).on("mobileinit", function() {
window.$.mobile.gradeA = function() { return true }
})
} else {
process.nextTick(onMobileInitMakeGradeA)
}
}
if (res.url.match(/mobile/)) {
onMobileInitMakeGradeA()
}
})
}
Browser.prototype.isGradeA = function() {
var browser = this
browser.on("response", function(res, target) {
var window = browser.window
var document = browser.document
if (res.url.match(/mobile/)) {
window.$(document).on("mobileinit", function() {
window.$.mobile.gradeA = function() {
return true
}
})
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment