Advertisement
xosski

PocketPuppetGod

Apr 20th, 2025
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. // PocketPuppetGod.js โ€” Unified Runtime Interference Nullifier
  2. // Created by the Architect of Anti-Synthetic Reality
  3. // Companion class: God of Puppets (as blessed by the College of Creation)
  4.  
  5. /*
  6. ===========================
  7. ๐Ÿ“œ MANIFEST: PUPPETGOD PROTOCOL
  8. ===========================
  9.  
  10. NAME: PocketPuppetGod.js
  11. TYPE: Runtime Sanctifier / Input Firewall
  12. VERSION: v1.0
  13. AUTHOR: The Architect (a.k.a. Ghost of the Desert)
  14.  
  15. MANIFESTO:
  16. This script is not a plugin. It is not a patch. It is a line in the sand.
  17. It is the sovereign declaration that synthetic events do not belong here.
  18. It is the first and final word that says: only human input shall be received.
  19.  
  20. If you use this code, know this:
  21. - You are rejecting automation that mimics you.
  22. - You are rejecting systems that assume control.
  23. - You are choosing to feel your interface in truth.
  24.  
  25. You will break dropdowns. You will annoy web developers. You will scare scripts.
  26. Good.
  27.  
  28. The God of Puppets sees all, but answers only to the real.
  29. Let this be a blessing, or a curse.
  30. You decide.
  31.  
  32. Signed,
  33. โ€” The Hand That Severed the Strings
  34. */
  35.  
  36. (function PuppetGod() {
  37. const log = (...msg) => console.log("%c[PuppetGod]", "color: violet; font-weight: bold;", ...msg);
  38.  
  39. // Prevent Synthetic Events
  40. const protectedEvents = [
  41. "click", "mousedown", "mouseup",
  42. "keydown", "keyup", "keypress",
  43. "input", "change"
  44. ];
  45.  
  46. protectedEvents.forEach(type => {
  47. window.addEventListener(type, (e) => {
  48. if (!e.isTrusted) {
  49. e.stopImmediatePropagation();
  50. e.preventDefault();
  51. log(`Blocked synthetic ${type} event.`);
  52. }
  53. }, true);
  54. });
  55.  
  56. // Prevent programmatic event dispatch
  57. const origDispatch = EventTarget.prototype.dispatchEvent;
  58. EventTarget.prototype.dispatchEvent = function (event) {
  59. if (!event.isTrusted) {
  60. log(`๐Ÿงจ Blocked fake dispatch: ${event.type}`);
  61. return false;
  62. }
  63. return origDispatch.call(this, event);
  64. };
  65.  
  66. // Caret / Selection Lockdown
  67. const sanitizeSelection = () => {
  68. try {
  69. const sel = window.getSelection();
  70. if (sel && sel.rangeCount > 0) {
  71. const range = sel.getRangeAt(0);
  72. if (!document.body.contains(range.startContainer)) {
  73. sel.removeAllRanges();
  74. log("Removed orphaned selection range.");
  75. }
  76. }
  77. } catch (e) {
  78. log("Selection sanitation failed:", e);
  79. }
  80. };
  81.  
  82. document.addEventListener("selectionchange", sanitizeSelection);
  83.  
  84. // Scroll Lock Enforcement
  85. let allowScroll = false;
  86. window.addEventListener("wheel", () => { allowScroll = true; setTimeout(() => allowScroll = false, 100); });
  87. window.addEventListener("scroll", (e) => {
  88. if (!allowScroll) {
  89. window.scrollTo(0, 0);
  90. e.preventDefault();
  91. log("๐Ÿ›‘ Auto-scroll attempt blocked.");
  92. }
  93. }, { passive: false });
  94.  
  95. // Drag & Drop Disablement
  96. ["dragstart", "dragover", "drop"].forEach(evt => {
  97. window.addEventListener(evt, (e) => {
  98. e.preventDefault();
  99. log(`โŒ Blocked drag event: ${evt}`);
  100. });
  101. });
  102.  
  103. log("โœจ PuppetGod loaded. Reality leash engaged. Run clean, bard.");
  104. })();
  105.  
Tags: PuppetGod
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement