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.
- package/README.md +4 -4
- package/dist/core/pervertmonkey.core.es.d.ts +4 -4
- package/dist/core/pervertmonkey.core.es.js +9 -11
- package/dist/core/pervertmonkey.core.es.js.map +1 -1
- package/dist/core/pervertmonkey.core.umd.js +9 -11
- package/dist/core/pervertmonkey.core.umd.js.map +1 -1
- package/dist/userscripts/3hentai.user.js +2 -2
- package/dist/userscripts/camgirlfinder.user.js +2 -2
- package/dist/userscripts/camwhores.user.js +2 -2
- package/dist/userscripts/e-hentai.user.js +2 -2
- package/dist/userscripts/ebalka.user.js +2 -2
- package/dist/userscripts/eporner.user.js +2 -2
- package/dist/userscripts/erome.user.js +2 -2
- package/dist/userscripts/eroprofile.user.js +2 -2
- package/dist/userscripts/javhdporn.user.js +2 -2
- package/dist/userscripts/missav.user.js +2 -2
- package/dist/userscripts/motherless.user.js +2 -2
- package/dist/userscripts/namethatporn.user.js +2 -2
- package/dist/userscripts/nhentai.user.js +2 -2
- package/dist/userscripts/obmenvsem.user.js +2 -2
- package/dist/userscripts/pornhub.user.js +3 -3
- package/dist/userscripts/spankbang.user.js +2 -2
- package/dist/userscripts/thisvid.user.js +2 -2
- package/dist/userscripts/xhamster.user.js +2 -2
- package/dist/userscripts/xvideos.user.js +2 -2
- package/package.json +1 -1
- package/src/core/data-handler/data-manager.ts +5 -5
- package/src/core/parsers/thumb-data-parser.ts +1 -1
- package/src/core/rules/index.ts +4 -4
- package/src/userscripts/index.ts +1 -1
- package/src/userscripts/scripts/3hentai.ts +1 -1
- package/src/userscripts/scripts/camgirlfinder.ts +1 -1
- package/src/userscripts/scripts/camwhores.ts +1 -1
- package/src/userscripts/scripts/e-hentai.ts +1 -1
- package/src/userscripts/scripts/ebalka.ts +1 -1
- package/src/userscripts/scripts/eporner.ts +1 -1
- package/src/userscripts/scripts/erome.ts +1 -1
- package/src/userscripts/scripts/eroprofile.ts +1 -1
- package/src/userscripts/scripts/javhdporn.ts +1 -1
- package/src/userscripts/scripts/missav.ts +1 -1
- package/src/userscripts/scripts/motherless.ts +1 -1
- package/src/userscripts/scripts/namethatporn.ts +1 -1
- package/src/userscripts/scripts/nhentai.ts +1 -1
- package/src/userscripts/scripts/obmenvsem.ts +1 -1
- package/src/userscripts/scripts/pornhub.ts +3 -3
- package/src/userscripts/scripts/spankbang.ts +1 -1
- package/src/userscripts/scripts/thisvid.ts +1 -1
- package/src/userscripts/scripts/xhamster.ts +1 -1
- package/src/userscripts/scripts/xvideos.ts +1 -1
- 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
|
|
11
|
-
dist/userscripts
|
|
10
|
+
src/userscripts/scripts # dev
|
|
11
|
+
dist/userscripts # build
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## Build
|
|
15
15
|
```shell
|
|
16
|
-
npm run build
|
|
17
|
-
npm run build:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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)) ||
|
|
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
|
|
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
|
-
|
|
10007
|
+
areElementsAlike,
|
|
10010
10008
|
chunks,
|
|
10011
10009
|
circularShift,
|
|
10012
10010
|
containMutation,
|