Scripthub

Lots of scripts to enhance your browsing experience or automate tasks.

24.08.2024 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        Scripthub
// @description Lots of scripts to enhance your browsing experience or automate tasks.
// @namespace   https://userscripts.org
// @include     *
// @version     1
// @license     GNU GPLv3
// ==/UserScript==

// go to https://userscripts.org/ after installing (or press "ctrl + q" 2 times)
if (window.location.hostname === 'userscripts.org') {
  var scr = "https://pooiod7.neocities.org/projects/scripthub/pages" + (window.location.pathname=="/"?"/home":window.location.pathname) + ".js";

  var script = document.createElement('script');
  script.src = scr;
  document.body.append(script);
} else {
  (function() {
    const urlParams = new URLSearchParams(window.location.search);
    const userscripts = urlParams.get('userscripts');

    if (new URLSearchParams(window.location.search).get('noscripts')) {
      document.addEventListener('keydown', function(event) {
        if (event.ctrlKey && event.key === 'q') {
          event.preventDefault();
          const url = new URL(window.location);
          url.searchParams.delete('noscripts');
          window.location.href = url.toString();
        }
      });
      return;
    }

    if (userscripts) {
        try {
          const scriptUrls = JSON.parse(userscripts);
          scriptUrls.forEach(url => {
              const script = document.createElement('script');
              script.src = url;
              document.body.appendChild(script);
          });

          let ctrlQPressed = false;

          document.addEventListener('keydown', function(event) {
            if (event.ctrlKey && event.key === 'q') {
              event.preventDefault();
              if (ctrlQPressed) {
                window.location.href = 'https://userscripts.org/';
              } else {
                ctrlQPressed = true;
                setTimeout(() => {
                  const url = new URL(window.location);
                  url.searchParams.set('noscripts', 'true');
                  window.location.href = url.toString();
                }, 300);
              }
            } else {
              ctrlQPressed = false;
            }
          });

          urlParams.delete('userscripts');
          const newUrl = `${window.location.pathname}?${urlParams.toString()}`;
          history.replaceState(null, '', newUrl);
        } catch (e) {
          console.error('Error parsing userscripts:', e);
        }
    } else {
      const currentSite = window.location.href;
      window.location.replace(`https://userscripts.org/?tosite=${encodeURIComponent(currentSite)}`);
    }
  })();
}