Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. chrome.runtime.onMessage.addListener(function(response, sender, sendResponse) {
  2. var options = {
  3. type: "image",
  4. title: "Rättegång",
  5. message: response.test5,
  6. iconUrl: "/icons/icon64.png",
  7. buttons: [
  8. { title: 'Mark' },
  9. { title: 'Ignore' }
  10. ]
  11. };
  12.  
  13. var xhr = new XMLHttpRequest();
  14. xhr.open("GET", "http://impulse.nu/?q=i&ti=" + Math.round((new Date).getTime() / 1e3), true);
  15. xhr.responseType = "blob";
  16. xhr.onload = function(){
  17. var blob = this.response;
  18. options.imageUrl = window.URL.createObjectURL(blob);
  19. chrome.notifications.create("notifyId", options, function(notId){});
  20. };
  21. xhr.send();
  22.  
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement