Sukebetter-JS

Open images without annoying ads

2024-02-22 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Sukebetter-JS
// @homepage     https://github.com/inewhero/Sukebetter/tree/Sukebetter-JS
// @version      0.1
// @description  Open images without annoying ads
// @author       yosoro
// @match        *://javball.com/*
// @match        *://ovabee.com/*
// @match        *://cnxx.me/*
// @match        *://ai18.pics/*
// @match        *://porn4f.com/*
// @match        *://idol69.net/*
// @match        *://cnpics.org/*
// @match        *://cosplay18.pics/*
// @match        *://pig69.com/*
// @match        *://sukebei.nyaa.si/*
// @run-at       document-end
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js
// @namespace https://greasyfork.org/users/1263683
// ==/UserScript==

(function() {
    'use strict';

    //sukebei.nyaa.si ad remove
    if (window.location.origin=='https://sukebei.nyaa.si') {
        let fcscripts = document.getElementsByTagName('script');
        for (let i = 0; i < fcscripts.length; i++) {
            if (fcscripts[i].attributes.src) {
                if (fcscripts[i].attributes.src.value.search(/min/i) == -1){
                    console.log('remove ad scripts:' + fcscripts[i].attributes.src.value);
                    fcscripts[i].remove();
                }
            } else if (fcscripts[i].text) {
                if (fcscripts[i].text.search(/adConfig/i) != -1){
                    console.log('remove ad scripts:' + fcscripts[i].text.value);
                    fcscripts[i].remove();
                }
            }
        }
        document.getElementById('e71bf691-4eb4-453f-8f11-6f40280c18f6').remove();
        console.log('* Banner ad is removed.');
        let wrapper_elements = document.getElementsByClassName('exo_wrapper');
        setTimeout(function() {
            while (wrapper_elements.length > 0){
                document.querySelector("body > style").remove();
                wrapper_elements[0].parentNode.removeChild(wrapper_elements[0]);
                console.log('* Toast ad is removed.');
            }
        }, 2000);

        //sukebei.nyaa.si thumbnails detect
        if (window.location.pathname.includes('view')) {
            let detail_elements = document.getElementById('torrent-description').innerHTML;
            let thumb_regex = /<a href="([^"]+\_s.jpg)"[^>]*>/g;
            let thumb_addr;
            while ((thumb_addr = thumb_regex.exec(detail_elements)) != null) {
                window.open(thumb_addr[1], "_blank");
            }
        }

    //picture beds ad remove
    } else {
        let realimg=document.getElementsByTagName('meta')['twitter:image:src'].content;
        console.log(realimg);
        window.open(realimg,'_self');
    }
})();