Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- appAPI.ready(function($) {
- // Place your code here (you can also define new functions above this scope)
- // The $ object is the extension's jQuery object
- // Extension scope: Bind the requestData handler to process the data request from page
- $('body').bindExtensionEvent('requestData', function(e, data) {
- // Get the data from the local database
- // If you have not previously saved data to your local database, the data returns null
- // However, for the purpose of demo this demo, the data initialized
- var requestedData = appAPI.db.get('data') || {userId:'User Id',userName:'User Name',password:'Password',email:'Email Address'};
- // Return the data to the page by triggering the page's receiveData event
- $('body').fireExtensionEvent('receiveData', requestedData);
- });
- });
Add Comment
Please, Sign In to add comment