|
2 | 2 | // @name Improve Adult Experience |
3 | 3 | // @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 |
4 | 4 | // @icon https://external-content.duckduckgo.com/ip3/pornhub.com.ico |
5 | | -// @version 0.56 |
| 5 | +// @version 0.57 |
6 | 6 | // @downloadURL https://userscripts.codonaft.com/improve-adult-experience.user.js |
7 | 7 | // @grant GM_addStyle |
8 | 8 | // ==/UserScript== |
@@ -136,15 +136,19 @@ const getTopNode = (document, node, x, y) => { |
136 | 136 | } |
137 | 137 | }; |
138 | 138 |
|
139 | | -const updateUrl = (node, href) => { |
| 139 | +const updateUrl = (node, href, newTab = false) => { |
140 | 140 | const url = new URL(href); |
141 | 141 | url.pathname = url.pathname.replace('//', '/'); |
142 | 142 | node.href = url; |
143 | 143 | node.addEventListener('click', _ => { |
144 | 144 | if (!event.isTrusted) return; |
145 | 145 | event.preventDefault(); |
146 | 146 | event.stopImmediatePropagation(); |
147 | | - redirect(url); |
| 147 | + if (newTab) { |
| 148 | + window.open(url, '_blank'); |
| 149 | + } else { |
| 150 | + redirect(url); |
| 151 | + } |
148 | 152 | }, true); |
149 | 153 | }; |
150 | 154 |
|
@@ -730,16 +734,16 @@ const sites = { |
730 | 734 | const url = new URL(node.href); |
731 | 735 | const p = url.pathname; |
732 | 736 | 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/')) { |
735 | 739 | url.pathname += '/rating/'; |
736 | 740 | params.set('durationFrom', duration); |
737 | 741 | updateUrl(node, url); |
738 | | - } else if (unset && p === '/videos/') { |
| 742 | + } else if (p === '/videos/') { |
739 | 743 | url.pathname = '/top-rated/'; |
740 | 744 | params.set('durationFrom', duration); |
741 | 745 | updateUrl(node, url); |
742 | | - } else if (unset && p === '/most-viewed/month/') { |
| 746 | + } else if (p === '/most-viewed/month/') { |
743 | 747 | params.set('durationFrom', duration); |
744 | 748 | updateUrl(node, url); |
745 | 749 | } |
@@ -1170,10 +1174,9 @@ const sites = { |
1170 | 1174 |
|
1171 | 1175 | const href = node.href; |
1172 | 1176 | 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 | + } |
1177 | 1180 | return; |
1178 | 1181 | } |
1179 | 1182 | if (href.includes('/models/') && href.length === origin.length + '/models/a/'.length) return; |
|
0 commit comments