Greasy Fork is available in English.

Papergames Ban Bypass

Simple userscript to clear local storage, session storage, and cookies for unban purposes.

  1. // ==UserScript==
  2. // @name Papergames Ban Bypass
  3. // @namespace github.com/longkidkoolstar
  4. // @version 2.1
  5. // @description Simple userscript to clear local storage, session storage, and cookies for unban purposes.
  6. // @author longkidkoolstar
  7. // @icon https://i.imgur.com/nxEJksd.png
  8. // @match https://papergames.io/*
  9. // @grant GM_registerMenuCommand
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Helper function to delete a cookie by name, path, and domain
  18. // Function to delete cookies for a specific domain
  19. function deleteCookie(name, domain) {
  20. const paths = ['/', '/path/', '/cookiepath/', '/morepath/', '/allpaths/']; // Add more paths or wildcard
  21.  
  22. if (domain) {
  23. // Delete cookie for specific domain
  24. paths.forEach(path => {
  25. document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; domain=${domain}; path=${path}`;
  26. });
  27. } else {
  28. // Delete cookie for current domain
  29. paths.forEach(path => {
  30. document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${path}`;
  31. });
  32. }
  33. }
  34. // Function to clear cookies for a specific domain
  35. function clearCookiesForDomain(domain) {
  36. const cookies = document.cookie.split("; ");
  37. cookies.forEach(cookie => {
  38. const cookieName = cookie.split("=")[0];
  39. deleteCookie(cookieName, domain);
  40. deleteCookie(cookieName, `.${domain}`); // Try subdomains
  41. });
  42. }
  43. // Function to clear local storage, session storage, and cookies
  44. function clearDataForDomain(domain) {
  45. console.log(`Clearing data for domain: ${domain}`);
  46. // Clear cookies for the domain and subdomains
  47. clearCookiesForDomain(domain);
  48. // Clear local storage and session storage
  49. localStorage.clear();
  50. sessionStorage.clear();
  51. }
  52. // Function to clear data for current domain and other specified domains
  53. function clearAllData() {
  54. // Clear data for the current domain
  55. clearDataForDomain(window.location.hostname);
  56. // Clear data for other domains (like Google)
  57. const otherDomains = ["papergames.io", "www.google.com"];
  58. otherDomains.forEach(domain => clearDataForDomain(domain));
  59. alert("Local storage, session storage, and cookies cleared.");
  60. }
  61. // Create "Unban" button in the Greasemonkey/Tampermonkey menu
  62. GM_registerMenuCommand("Unban", clearAllData);
  63. })();