Skip to content

Commit 052175c

Browse files
committed
Update
1 parent 461b713 commit 052175c

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

improve-adult-experience.user.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name Improve Adult Experience
33
// @description Skip intros, set better default quality/duration filters, make unwanted video previews transparent, workaround load failures, make input more consistent across the websites. Designed for a separate browser profile. Supported websites: anysex.com, beeg.com, bingato.com, drtuber.com, hqporner.com, hdzog.tube, hypnotube.com, incestporno.vip, inporn.com, manysex.com, mat6tube.com, pmvhaven.com, porn00.tv, pornhits.com, pornhub.com, porno365.best, porntrex.com, pornxp.com, redtube.com, spankbang.com, taboodude.com, tnaflix.com, tube8.com, txxx.com, veporn.com, vxxx.com, whoreshub.com, xgroovy.com, xhamster.com, xnxx.com, xvideos.com, xxxbp.tv, рус-порно.tv
44
// @icon https://external-content.duckduckgo.com/ip3/pornhub.com.ico
5-
// @version 0.56
5+
// @version 0.57
66
// @downloadURL https://userscripts.codonaft.com/improve-adult-experience.user.js
77
// @grant GM_addStyle
88
// ==/UserScript==
@@ -136,15 +136,19 @@ const getTopNode = (document, node, x, y) => {
136136
}
137137
};
138138

139-
const updateUrl = (node, href) => {
139+
const updateUrl = (node, href, newTab = false) => {
140140
const url = new URL(href);
141141
url.pathname = url.pathname.replace('//', '/');
142142
node.href = url;
143143
node.addEventListener('click', _ => {
144144
if (!event.isTrusted) return;
145145
event.preventDefault();
146146
event.stopImmediatePropagation();
147-
redirect(url);
147+
if (newTab) {
148+
window.open(url, '_blank');
149+
} else {
150+
redirect(url);
151+
}
148152
}, true);
149153
};
150154

@@ -730,16 +734,16 @@ const sites = {
730734
const url = new URL(node.href);
731735
const p = url.pathname;
732736
const params = url.searchParams;
733-
const unset = !params.has('durationFrom');
734-
if (unset && p.startsWith('/channels/' && !p.endsWith('/channels/'))) {
737+
if (params.has('durationFrom')) return;
738+
if (p.startsWith('/channels/')) {
735739
url.pathname += '/rating/';
736740
params.set('durationFrom', duration);
737741
updateUrl(node, url);
738-
} else if (unset && p === '/videos/') {
742+
} else if (p === '/videos/') {
739743
url.pathname = '/top-rated/';
740744
params.set('durationFrom', duration);
741745
updateUrl(node, url);
742-
} else if (unset && p === '/most-viewed/month/') {
746+
} else if (p === '/most-viewed/month/') {
743747
params.set('durationFrom', duration);
744748
updateUrl(node, url);
745749
}
@@ -1170,10 +1174,9 @@ const sites = {
11701174

11711175
const href = node.href;
11721176
if (href.includes('/video/')) {
1173-
node.addEventListener('click', _ => {
1174-
if (!event.isTrusted) return;
1175-
resetVideo();
1176-
}, true);
1177+
if (loc.pathname.startsWith('/playlists/')) {
1178+
updateUrl(node, href, true);
1179+
}
11771180
return;
11781181
}
11791182
if (href.includes('/models/') && href.length === origin.length + '/models/a/'.length) return;

0 commit comments

Comments
 (0)