-
Notifications
You must be signed in to change notification settings - Fork 0
bridge
Yanis Wang edited this page Jul 10, 2014
·
4 revisions
Set pagerun object to browser.
So you can use some api in browser, like: pagerun.info('test' , 'message')
.
And all debug info will been catched, such as: console.log, alert, confirm, prompt
pagerun.setConfig({
'bridge': {
'delayDefaultEnd': 2000
}
});
-
delayDefaultEnd
Bridge will end after onload, this option will delay the end time.
Unit: microsecond.
This api will create a async task, pagerun will wait task until the task call this.end()
;
pagerun.newTask('taskname', function(){
var task = this;
task.info('start');
setTimeout(function(){
task.info('end');
task.end();
}, 2000);
});
The context support 4 apis:
- task.error : report error message
- task.warn : report warning message
- task.info : report info message
- task.end : end this task
Report error message directly.
Report warn message directly.
Report info message directly.
Get all message result.
Bind pagerun event.
Emit pagerun event.