localstorage_spoofing

disable localstorage

  1. // ==UserScript==
  2. // @name localstorage_spoofing
  3. // @description disable localstorage
  4. // @namespace http://userscripts.org/users/
  5. // @include http://*
  6. // @include https://*
  7. // @version 0.1
  8. // @run-at document-start
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var mockStorage={
  13. length:0,
  14. clear:function (){},
  15. getItem:function (){return null;},
  16. key:function (){return null;},
  17. removeItem:function (){},
  18. setItem:function (){},
  19. };
  20.  
  21. Object.defineProperty(unsafeWindow, 'localStorage', {
  22. get: function () {
  23. return mockStorage;
  24. }
  25. });