Created
November 7, 2012 10:19
-
-
Save fgalassi/4030727 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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