Created
November 18, 2014 19:22
-
-
Save purplecabbage/fc1731a1e30db3e7a72e to your computer and use it in GitHub Desktop.
Prevent native calls, and do nothing on cordova.exec api calls.
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
var cordovaExec = cordova.exec; | |
var log = console.log; | |
cordova.exec = function(ftw, wtf, service, action, args) { | |
var cbId = service + cordova.callbackId++; | |
cordova.callbacks[cbId] = {success: ftw, fail: wtf}; | |
log("Blocked call to : " + service + "/" + action); | |
log("Args to call were : " + JSON.stringify(args)); | |
log('callbackId is ' + cbId); | |
} | |
log("cordova.exec has been plugged, in order to push a result, call : "); | |
log("cordova.callbackFromNative(callbackId, isSuccess, status, args, keepCallback);"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment