Guest User

Untitled

a guest
Nov 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function onRemoved(cookie) {
  2. console.log(`Removed: ${cookie}`);
  3. }
  4.  
  5. function onError(error) {
  6. console.log(`Error removing cookie: ${error}`);
  7. }
  8.  
  9. function removeCookie() {
  10. var removing = browser.cookies.remove({
  11. url: "example.com"
  12. });
  13. removing.then(onRemoved, onError);
  14. }
  15.  
  16. browser.browserAction.onClicked.addListener(removeCookie);
  17.  
  18. {
  19.  
  20. "description": "RemoveCookie",
  21. "manifest_version": 2,
  22. "name": "remove-cookies",
  23. "version": "1.0",
  24. "icons": {
  25. "48": "icons/icon.png"
  26. },
  27.  
  28. "background": {
  29. "scripts": ["background.js"]
  30. },
  31.  
  32. "browser_action": {
  33. "default_icon": "icons/icon.png",
  34. "default_title": "Remove Cookie!"
  35. },
  36.  
  37. "permissions": [
  38. "*://*.example.com/*",
  39. "cookies"
  40. ]
  41. }
Add Comment
Please, Sign In to add comment