|
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. Supported websites: pornhub.com, xvideos.com, spankbang.com, porntrex.com, xhamster.com |
4 | 4 | // @icon https://www.google.com/s2/favicons?sz=64&domain=pornhub.com |
5 | | -// @version 0.15 |
| 5 | +// @version 0.16 |
6 | 6 | // @downloadURL https://userscripts.codonaft.com/improve-adult-experience.js |
7 | 7 | // @match https://spankbang.com/* |
8 | 8 | // @match https://www.pornhub.com/* |
|
462 | 462 | style.innerHTML = ` |
463 | 463 | div.${UNWANTED} { opacity: 10%; } |
464 | 464 | div.${UNWANTED}:hover { opacity: 40%; } |
| 465 | + ${MINOR_IMPROVEMENTS ? 'div[x-data="gifPage"] { display: none; }' : ''} |
465 | 466 | `; |
466 | 467 | body.appendChild(style); |
467 | | - |
468 | | - if (MINOR_IMPROVEMENTS) { |
469 | | - body.querySelectorAll('div[x-data="gifPage"]').forEach(i => i.style.display = 'none'); |
470 | | - } |
471 | 468 | } catch (e) { |
472 | 469 | console.error(e); |
473 | 470 | } |
|
540 | 537 | console.log('applying style'); |
541 | 538 | const style = document.createElement('style'); |
542 | 539 | 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%; } |
545 | 542 | `; |
546 | 543 | // TODO: div.sort-holder { display: none !important; } ? |
547 | 544 | body.appendChild(style); |
|
551 | 548 |
|
552 | 549 | let initializedVideo = false; |
553 | 550 | 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); |
555 | 552 | 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); |
561 | 554 | } else if (validLink(node)) { |
562 | 555 | const href = node.href; |
563 | 556 | if (href.includes('/video/')) return; |
|
0 commit comments