pervert-monkey 1.0.19 → 1.0.20

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 (50) hide show
  1. package/README.md +4 -4
  2. package/dist/core/pervertmonkey.core.es.d.ts +4 -4
  3. package/dist/core/pervertmonkey.core.es.js +9 -11
  4. package/dist/core/pervertmonkey.core.es.js.map +1 -1
  5. package/dist/core/pervertmonkey.core.umd.js +9 -11
  6. package/dist/core/pervertmonkey.core.umd.js.map +1 -1
  7. package/dist/userscripts/3hentai.user.js +2 -2
  8. package/dist/userscripts/camgirlfinder.user.js +2 -2
  9. package/dist/userscripts/camwhores.user.js +2 -2
  10. package/dist/userscripts/e-hentai.user.js +2 -2
  11. package/dist/userscripts/ebalka.user.js +2 -2
  12. package/dist/userscripts/eporner.user.js +2 -2
  13. package/dist/userscripts/erome.user.js +2 -2
  14. package/dist/userscripts/eroprofile.user.js +2 -2
  15. package/dist/userscripts/javhdporn.user.js +2 -2
  16. package/dist/userscripts/missav.user.js +2 -2
  17. package/dist/userscripts/motherless.user.js +2 -2
  18. package/dist/userscripts/namethatporn.user.js +2 -2
  19. package/dist/userscripts/nhentai.user.js +2 -2
  20. package/dist/userscripts/obmenvsem.user.js +2 -2
  21. package/dist/userscripts/pornhub.user.js +3 -3
  22. package/dist/userscripts/spankbang.user.js +2 -2
  23. package/dist/userscripts/thisvid.user.js +2 -2
  24. package/dist/userscripts/xhamster.user.js +2 -2
  25. package/dist/userscripts/xvideos.user.js +2 -2
  26. package/package.json +1 -1
  27. package/src/core/data-handler/data-manager.ts +5 -5
  28. package/src/core/parsers/thumb-data-parser.ts +1 -1
  29. package/src/core/rules/index.ts +4 -4
  30. package/src/userscripts/index.ts +1 -1
  31. package/src/userscripts/scripts/3hentai.ts +1 -1
  32. package/src/userscripts/scripts/camgirlfinder.ts +1 -1
  33. package/src/userscripts/scripts/camwhores.ts +1 -1
  34. package/src/userscripts/scripts/e-hentai.ts +1 -1
  35. package/src/userscripts/scripts/ebalka.ts +1 -1
  36. package/src/userscripts/scripts/eporner.ts +1 -1
  37. package/src/userscripts/scripts/erome.ts +1 -1
  38. package/src/userscripts/scripts/eroprofile.ts +1 -1
  39. package/src/userscripts/scripts/javhdporn.ts +1 -1
  40. package/src/userscripts/scripts/missav.ts +1 -1
  41. package/src/userscripts/scripts/motherless.ts +1 -1
  42. package/src/userscripts/scripts/namethatporn.ts +1 -1
  43. package/src/userscripts/scripts/nhentai.ts +1 -1
  44. package/src/userscripts/scripts/obmenvsem.ts +1 -1
  45. package/src/userscripts/scripts/pornhub.ts +3 -3
  46. package/src/userscripts/scripts/spankbang.ts +1 -1
  47. package/src/userscripts/scripts/thisvid.ts +1 -1
  48. package/src/userscripts/scripts/xhamster.ts +1 -1
  49. package/src/userscripts/scripts/xvideos.ts +1 -1
  50. package/src/utils/dom/index.ts +3 -5
package/README.md CHANGED
@@ -7,14 +7,14 @@
7
7
 
8
8
  ## Userscripts
9
9
  ```shell
10
- src/userscripts/scripts # dev
11
- dist/userscripts # build
10
+ src/userscripts/scripts # dev
11
+ dist/userscripts # build
12
12
  ```
13
13
 
14
14
  ## Build
15
15
  ```shell
16
- npm run build # build core
17
- npm run build:userscripts # build userscripts
16
+ npm run build # build core
17
+ npm run build:u # build userscripts
18
18
  ```
19
19
 
20
20
  ## Dev
@@ -7,7 +7,7 @@ import { Subject } from 'rxjs';
7
7
 
8
8
  declare type AnyFunction = (...args: any[]) => any;
9
9
 
10
- export declare function checkHomogenity<T extends HTMLElement>(a: T, b: T, options: {
10
+ export declare function areElementsAlike<T extends HTMLElement>(a: T, b: T, options: {
11
11
  id?: boolean;
12
12
  className?: boolean;
13
13
  }): boolean;
@@ -69,7 +69,7 @@ export declare class DataManager {
69
69
  data: Map<string, DataElement>;
70
70
  private lazyImgLoader;
71
71
  dataFilter: DataFilter;
72
- constructor(rules: Rules, containerHomogenity?: Parameters<typeof checkHomogenity>[2] | undefined);
72
+ constructor(rules: Rules, containerHomogenity?: Parameters<typeof areElementsAlike>[2] | undefined);
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>;
@@ -407,12 +407,12 @@ export declare function removeClassesAndDataAttributes(element: HTMLElement, key
407
407
  export declare function replaceElementTag(e: HTMLElement, tagName: string): HTMLElement;
408
408
 
409
409
  export declare class Rules {
410
+ thumbs: Parameters<typeof ThumbsParser.create>[0];
411
+ thumbsParser: ThumbsParser;
410
412
  thumb: Parameters<typeof ThumbDataParser.create>[0];
411
413
  thumbDataParser: ThumbDataParser;
412
414
  thumbImg: Parameters<typeof ThumbImgParser.create>[0];
413
415
  thumbImgParser: ThumbImgParser;
414
- thumbs: Parameters<typeof ThumbsParser.create>[0];
415
- thumbsParser: ThumbsParser;
416
416
  containerSelector: string | (() => HTMLElement);
417
417
  containerSelectorLast?: string;
418
418
  get container(): HTMLElement;
@@ -237,11 +237,9 @@ function findNextSibling(e) {
237
237
  if (e.parentElement) return findNextSibling(e.parentElement);
238
238
  return null;
239
239
  }
240
- function checkHomogenity(a2, b2, options) {
240
+ function areElementsAlike(a2, b2, options) {
241
241
  if (!a2 || !b2) return false;
242
- if (options.id) {
243
- if (a2.id !== b2.id) return false;
244
- }
242
+ if (options.id && a2.id !== b2.id) return false;
245
243
  if (options.className) {
246
244
  const ca2 = a2.className;
247
245
  const cb = b2.className;
@@ -648,12 +646,12 @@ class DataManager {
648
646
  const homogenity = !!this.containerHomogenity;
649
647
  for (const thumbElement of thumbs) {
650
648
  const url = this.rules.thumbDataParser.getUrl(thumbElement);
651
- const isHomogenic = homogenity && !checkHomogenity(
649
+ const isNotHomogenic = homogenity && !areElementsAlike(
652
650
  parent,
653
651
  thumbElement.parentElement,
654
652
  this.containerHomogenity
655
653
  );
656
- if (!url || this.data.has(url) || parent !== container && (parent == null ? void 0 : parent.contains(thumbElement)) || isHomogenic) {
654
+ if (!url || this.data.has(url) || parent !== container && (parent == null ? void 0 : parent.contains(thumbElement)) || isNotHomogenic) {
657
655
  if (removeDuplicates) thumbElement.remove();
658
656
  continue;
659
657
  }
@@ -3078,7 +3076,7 @@ class ThumbDataParser {
3078
3076
  return { title, duration };
3079
3077
  }
3080
3078
  getUrl(thumb) {
3081
- return (thumb.querySelector("a[href]") || thumb).href;
3079
+ return querySelectorOrSelf(thumb, "a[href]").href;
3082
3080
  }
3083
3081
  preprocessCustomThumbDataSelectors() {
3084
3082
  if (!this.selectors) return;
@@ -9861,12 +9859,12 @@ function getSelectorFnsFromScheme(xs2) {
9861
9859
  }
9862
9860
  class Rules {
9863
9861
  constructor(options) {
9862
+ __publicField(this, "thumbs", {});
9863
+ __publicField(this, "thumbsParser");
9864
9864
  __publicField(this, "thumb", {});
9865
9865
  __publicField(this, "thumbDataParser");
9866
9866
  __publicField(this, "thumbImg", {});
9867
9867
  __publicField(this, "thumbImgParser");
9868
- __publicField(this, "thumbs", {});
9869
- __publicField(this, "thumbsParser");
9870
9868
  __publicField(this, "containerSelector", ".container");
9871
9869
  __publicField(this, "containerSelectorLast");
9872
9870
  __publicField(this, "intersectionObservableSelector");
@@ -9890,9 +9888,9 @@ class Rules {
9890
9888
  __publicField(this, "onResetCallback");
9891
9889
  if (this.isEmbedded) throw Error("Embedded is not supported");
9892
9890
  Object.assign(this, options);
9891
+ this.thumbsParser = ThumbsParser.create(this.thumbs);
9893
9892
  this.thumbDataParser = ThumbDataParser.create(this.thumb);
9894
9893
  this.thumbImgParser = ThumbImgParser.create(this.thumbImg);
9895
- this.thumbsParser = ThumbsParser.create(this.thumbs);
9896
9894
  this.paginationStrategy = getPaginationStrategy(this.paginationStrategyOptions);
9897
9895
  this.store = this.createStore();
9898
9896
  this.gui = this.createGui();
@@ -10006,7 +10004,7 @@ export {
10006
10004
  ThumbImgParser,
10007
10005
  ThumbsParser,
10008
10006
  Tick,
10009
- checkHomogenity,
10007
+ areElementsAlike,
10010
10008
  chunks,
10011
10009
  circularShift,
10012
10010
  containMutation,