Guest User

Untitled

a guest
Nov 21st, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. appAPI.ready(function($) {
  2. // Place your code here (you can also define new functions above this scope)
  3. // The $ object is the extension's jQuery object
  4.  
  5. // Extension scope: Bind the requestData handler to process the data request from page
  6. $('body').bindExtensionEvent('requestData', function(e, data) {
  7. // Get the data from the local database
  8. // If you have not previously saved data to your local database, the data returns null
  9. // However, for the purpose of demo this demo, the data initialized
  10. var requestedData = appAPI.db.get('data') || {userId:'User Id',userName:'User Name',password:'Password',email:'Email Address'};
  11.  
  12. // Return the data to the page by triggering the page's receiveData event
  13. $('body').fireExtensionEvent('receiveData', requestedData);
  14. });
  15. });
Add Comment
Please, Sign In to add comment