Czogista

renewMCharCookie

Aug 14th, 2021
1,799
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         renewMCharCookie
  3. // @namespace    http://czogi.usermd.net
  4. // @version      1
  5. // @description  Przedłużanie ciasteczka mchar_id co refresh strony
  6. // @include      /http[s]{0,1}:\/\/[a-z]{4,15}\.margonem\.pl/
  7. // @noframes
  8. // @author       Czogi
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. {
  13.   document.cookie?.split("; ").map((cookie) => {
  14.     const [key, val] = cookie.split("=");
  15.     if (key !== "mchar_id") {
  16.       return;
  17.     }
  18.  
  19.     document.cookie = `${key}=${val}; expires=${new Date(
  20.       new Date().getTime() + 604800000 // 7 dni.
  21.     ).toUTCString()}; domain=.margonem.pl; path=/;`;
  22.   });
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment