Advertisement
xosski

Off screen to on screen duel/anti mage hand

Apr 10th, 2025
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. Trigger intersection observers
  2. // Patch IntersectionObserver to trigger all observed elements
  3. IntersectionObserver.prototype.observe = function(target) {
  4. // Force callback immediately
  5. const callback = this.callback || (() => {});
  6. callback([{ isIntersecting: true, target }]);
  7. };
  8.  
  9. // Optional: fake callback for existing observers
  10. document.querySelectorAll('*').forEach(el => {
  11. try {
  12. el.scrollIntoView({ behavior: 'auto', block: 'center' });
  13. } catch {}
  14. });
  15.  
  16. Force reveal hidden lazy dom loaders
  17. // Remove hidden styles
  18. [...document.querySelectorAll('*')].forEach(el => {
  19. el.style.display = 'block';
  20. el.style.visibility = 'visible';
  21. el.style.opacity = '1';
  22. el.style.transform = 'none';
  23. });
  24. Trigger lazy loaders
  25. // Hijack setTimeout to run immediately
  26. const _setTimeout = window.setTimeout;
  27. window.setTimeout = function(fn, delay, ...args) {
  28. return _setTimeout(fn, 0, ...args);
  29. };
  30.  
  31. // Run requestIdleCallbacks immediately
  32. window.requestIdleCallback = function(fn) {
  33. return fn({ didTimeout: false, timeRemaining: () => 50 });
  34. };
  35. Stub or override lazy load libraries
  36. window.lozad = () => ({
  37. observe: () => console.log('lozad hijacked')
  38. });
  39.  
  40. window.lazySizes = {
  41. init: () => console.log('lazySizes hijacked')
  42. };
  43. Trigger events that load stuff
  44. // Simulate scroll to bottom
  45. window.scrollTo(0, document.body.scrollHeight);
  46.  
  47. // Dispatch fake user interaction
  48. ['click', 'mousemove', 'keydown'].forEach(evt =>
  49. document.dispatchEvent(new Event(evt))
  50. );
  51.  
  52. Crawl every link and load images
  53. // Preload all images
  54. document.querySelectorAll('img[data-src], img[data-lazy-src], img[loading="lazy"]').forEach(img => {
  55. img.src = img.dataset.src || img.dataset.lazySrc;
  56. img.loading = 'eager';
  57. });
  58.  
  59. // Preload links
  60. document.querySelectorAll('a[href]').forEach(link => {
  61. fetch(link.href).catch(() => {}); // we're just being loud
  62. });
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement