☰

Sleazy Fork is available in English.

SpankBang Age Verification

SpankBang Age Verification by JusyX

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         SpankBang Age Verification
// @namespace    JusyX
// @version      1.1
// @description  SpankBang Age Verification by JusyX
// @match        https://spankbang.com/*
// @match        https://*.spankbang.com/*
// @match        *://spankbang.*/*
// @match        *://spankbang.party/*
// @grant        none
// @run-at       document-idle
//  @license       MIT
// ==/UserScript==

(function () {
    'use strict';
    const replacements = {
        coc: 'CA',
        coe: 'us'
    };
    const currentCookies = {};
    document.cookie.split(';').forEach(cookie => {
        const [name, ...value] = cookie.trim().split('=');
        currentCookies[name] = value.join('=');
    });
    if (
        currentCookies.coc === 'CA' &&
        currentCookies.coe === 'us'
    ) {
        return;
    }
    const parts = location.hostname.split('.');
    const domains = [null];
    for (let i = 0; i < parts.length - 1; i++) {
        domains.push('.' + parts.slice(i).join('.'));
    }
    for (const name of Object.keys(replacements)) {
        for (const domain of domains) {
            const domainPart = domain ? `; domain=${domain}` : '';
            document.cookie =
                `${name}=; Max-Age=0; path=/${domainPart}`;
        }
    }
    for (const [name, value] of Object.entries(replacements)) {
        document.cookie =
            `${name}=${value}; path=/; SameSite=Lax`;
    }
    location.reload();
})();