Advertisement
dandrei

facebook.com | Activity Log Time Travel

Aug 16th, 2023 (edited)
1,781
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        facebook.com | Activity Log Time Travel
  3. // @match       https://www.facebook.com/*
  4. // ==/UserScript==
  5.  
  6. function set(key, diff) {
  7.   const url = new URL(window.location.href);
  8.   const value = parseInt(url.searchParams.get(key));
  9.   url.searchParams.set(key, value + diff);
  10.   window.location.href = url.toString();
  11. }
  12.  
  13. function inc_year(diff) {
  14.   set('year', diff);
  15. }
  16.  
  17. function inc_month(diff) {
  18.   set('month', diff);
  19. }
  20.  
  21. Object.assign(unsafeWindow, {inc_year, inc_month});
  22.  
  23. // bookmarklets
  24. // y+ javascript:inc_year(1);void(0);
  25. // y- javascript:inc_year(-1);void(0);
  26. // m+ javascript:inc_month(1);void(0);
  27. // m- javascript:inc_month(-1);void(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement