Greasy Fork is available in English.

KoGaMa Fix DisallowedURL Input

Replace dots with %2E in copy-pasted links

// ==UserScript==
// @name         KoGaMa Fix DisallowedURL Input
// @namespace    https://github.com/deeformed
// @version      1.4
// @description  Replace dots with %2E in copy-pasted links
// @author       Simon
// @match        https://www.kogama.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('paste', function(event) {
      
        const clipboardData = (event.clipboardData || window.clipboardData).getData('text');

       
        if (clipboardData.startsWith('http://') || clipboardData.startsWith('https://')) {
            
            const formattedLink = clipboardData.replace(/\./g, '%2E');

            
            document.execCommand('insertText', false, formattedLink);

            
            event.preventDefault();
        }
    });
})();