pervert-monkey 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/core/pervertmonkey.core.es.d.ts +2 -0
  2. package/dist/core/pervertmonkey.core.es.js +11 -3
  3. package/dist/core/pervertmonkey.core.es.js.map +1 -1
  4. package/dist/core/pervertmonkey.core.umd.js +11 -3
  5. package/dist/core/pervertmonkey.core.umd.js.map +1 -1
  6. package/dist/userscripts/3hentai.user.js +2 -2
  7. package/dist/userscripts/camgirlfinder.user.js +2 -2
  8. package/dist/userscripts/camwhores.user.js +2 -2
  9. package/dist/userscripts/e-hentai.user.js +2 -2
  10. package/dist/userscripts/ebalka.user.js +2 -2
  11. package/dist/userscripts/eporner.user.js +2 -2
  12. package/dist/userscripts/erome.user.js +4 -6
  13. package/dist/userscripts/eroprofile.user.js +2 -2
  14. package/dist/userscripts/javhdporn.user.js +2 -2
  15. package/dist/userscripts/missav.user.js +2 -2
  16. package/dist/userscripts/motherless.user.js +2 -2
  17. package/dist/userscripts/namethatporn.user.js +2 -2
  18. package/dist/userscripts/nhentai.user.js +2 -2
  19. package/dist/userscripts/obmenvsem.user.js +2 -2
  20. package/dist/userscripts/pornhub.user.js +2 -2
  21. package/dist/userscripts/spankbang.user.js +2 -2
  22. package/dist/userscripts/thisvid.user.js +2 -2
  23. package/dist/userscripts/xhamster.user.js +2 -2
  24. package/dist/userscripts/xvideos.user.js +2 -2
  25. package/package.json +1 -1
  26. package/src/core/data-handler/data-manager.ts +11 -3
  27. package/src/core/rules/index.ts +2 -0
  28. package/src/userscripts/index.ts +1 -1
  29. package/src/userscripts/scripts/3hentai.ts +1 -1
  30. package/src/userscripts/scripts/camgirlfinder.ts +1 -1
  31. package/src/userscripts/scripts/camwhores.ts +1 -1
  32. package/src/userscripts/scripts/e-hentai.ts +1 -1
  33. package/src/userscripts/scripts/ebalka.ts +1 -1
  34. package/src/userscripts/scripts/eporner.ts +1 -1
  35. package/src/userscripts/scripts/erome.ts +2 -6
  36. package/src/userscripts/scripts/eroprofile.ts +1 -1
  37. package/src/userscripts/scripts/javhdporn.ts +1 -1
  38. package/src/userscripts/scripts/missav.ts +1 -1
  39. package/src/userscripts/scripts/motherless.ts +1 -1
  40. package/src/userscripts/scripts/namethatporn.ts +1 -1
  41. package/src/userscripts/scripts/nhentai.ts +1 -1
  42. package/src/userscripts/scripts/obmenvsem.ts +1 -1
  43. package/src/userscripts/scripts/pornhub.ts +1 -1
  44. package/src/userscripts/scripts/spankbang.ts +1 -1
  45. package/src/userscripts/scripts/thisvid.ts +1 -1
  46. package/src/userscripts/scripts/xhamster.ts +1 -1
  47. package/src/userscripts/scripts/xvideos.ts +1 -1
@@ -73,6 +73,7 @@ export declare class DataManager {
73
73
  applyFilters(filters?: Record<string, boolean>, offset?: number): Promise<void>;
74
74
  filterAll(offset?: number): Promise<void>;
75
75
  parseData(html: HTMLElement, container?: HTMLElement, removeDuplicates?: boolean, shouldLazify?: boolean): Promise<void>;
76
+ private optimize;
76
77
  sortBy<K extends keyof DataElement>(key: K, direction?: boolean): void;
77
78
  }
78
79
 
@@ -440,6 +441,7 @@ export declare class Rules {
440
441
  gropeStrategy: 'all-in-one' | 'all-in-all';
441
442
  gropeInit(): void;
442
443
  get isEmbedded(): boolean;
444
+ containMutationEnabled: boolean;
443
445
  private mutationObservers;
444
446
  resetOnPaginationOrContainerDeath: boolean;
445
447
  private resetOn;
@@ -626,7 +626,7 @@ class DataManager {
626
626
  f();
627
627
  } else {
628
628
  requestAnimationFrame(() => {
629
- containMutation(parent, f);
629
+ this.optimize(parent, f);
630
630
  });
631
631
  }
632
632
  });
@@ -665,7 +665,14 @@ class DataManager {
665
665
  }
666
666
  await this.filterAll(dataOffset);
667
667
  if (!parent) return;
668
- containMutation(parent, () => parent == null ? void 0 : parent.appendChild(fragment));
668
+ this.optimize(parent, () => parent == null ? void 0 : parent.appendChild(fragment));
669
+ }
670
+ optimize(container, mutation) {
671
+ if (this.rules.containMutationEnabled) {
672
+ containMutation(container, mutation);
673
+ } else {
674
+ mutation();
675
+ }
669
676
  }
670
677
  sortBy(key, direction = true) {
671
678
  if (this.data.size < 2) return;
@@ -675,7 +682,7 @@ class DataManager {
675
682
  for (const [container, items] of byContainers) {
676
683
  items.sort((a2, b2) => (a2[key] - b2[key]) * dir);
677
684
  const children = items.map((e) => e.element);
678
- containMutation(container, () => container.replaceChildren(...children));
685
+ this.optimize(container, () => container.replaceChildren(...children));
679
686
  }
680
687
  }
681
688
  }
@@ -9883,6 +9890,7 @@ class Rules {
9883
9890
  __publicField(this, "infiniteScroller");
9884
9891
  __publicField(this, "getPaginationData");
9885
9892
  __publicField(this, "gropeStrategy", "all-in-one");
9893
+ __publicField(this, "containMutationEnabled", true);
9886
9894
  __publicField(this, "mutationObservers", []);
9887
9895
  __publicField(this, "resetOnPaginationOrContainerDeath", true);
9888
9896
  __publicField(this, "onResetCallback");