Skip to content

Commit c7995da

Browse files
committed
Debug
1 parent 7bf93fd commit c7995da

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

improve-adult-experience.js

Lines changed: 6 additions & 13 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. Supported websites: pornhub.com, xvideos.com, spankbang.com, porntrex.com, xhamster.com
44
// @icon https://www.google.com/s2/favicons?sz=64&domain=pornhub.com
5-
// @version 0.15
5+
// @version 0.16
66
// @downloadURL https://userscripts.codonaft.com/improve-adult-experience.js
77
// @match https://spankbang.com/*
88
// @match https://www.pornhub.com/*
@@ -462,12 +462,9 @@
462462
style.innerHTML = `
463463
div.${UNWANTED} { opacity: 10%; }
464464
div.${UNWANTED}:hover { opacity: 40%; }
465+
${MINOR_IMPROVEMENTS ? 'div[x-data="gifPage"] { display: none; }' : ''}
465466
`;
466467
body.appendChild(style);
467-
468-
if (MINOR_IMPROVEMENTS) {
469-
body.querySelectorAll('div[x-data="gifPage"]').forEach(i => i.style.display = 'none');
470-
}
471468
} catch (e) {
472469
console.error(e);
473470
}
@@ -540,8 +537,8 @@
540537
console.log('applying style');
541538
const style = document.createElement('style');
542539
style.innerHTML = `
543-
div.${UNWANTED} { opacity: 10%; }
544-
div.${UNWANTED}:hover { opacity: 40%; }
540+
div.${UNWANTED}, span.${UNWANTED} { opacity: 10%; }
541+
div.${UNWANTED}:hover, div.${UNWANTED}:hover { opacity: 40%; }
545542
`;
546543
// TODO: div.sort-holder { display: none !important; } ?
547544
body.appendChild(style);
@@ -551,13 +548,9 @@
551548

552549
let initializedVideo = false;
553550
const processNode = node => {
554-
const unwanted = (node.matches('span.quality') && (Number(node.textContent.split('p')[0]) || 0) < MIN_VIDEO_HEIGHT) || (node.matches('div.durations') && timeToSeconds(node.textContent) < MIN_DURATION_MINS * 60);
551+
const unwanted = (node.matches('span.quality') && (Number(node.textContent.split('p')[0]) || 0) < MIN_VIDEO_HEIGHT) || (node.matches('div.durations, span.video-item-duration') && timeToSeconds(node.textContent) < MIN_DURATION_MINS * 60);
555552
if (unwanted) {
556-
node.closest('div.thumb-item')?.classList.add(UNWANTED);
557-
} else if (node.matches('div.durations')) {
558-
if (timeToSeconds(node.textContent) < MIN_DURATION_MINS * 60) {
559-
node.closest('div.thumb-item')?.classList.add(UNWANTED);
560-
}
553+
(node.closest('div.thumb-item') || node.closest('span.video-item')?.querySelector('span.thumb'))?.classList.add(UNWANTED);
561554
} else if (validLink(node)) {
562555
const href = node.href;
563556
if (href.includes('/video/')) return;

0 commit comments

Comments
 (0)