Remove Rounded Corners

Remove all rounded corners from web page elements

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         Remove Rounded Corners
// @name:zh-CN   去圆角(低水平自用)
// @namespace    Hypnos
// @version      1.01
// @description  Remove all rounded corners from web page elements
// @description:zh-cn 去援交(误
// @match        http://*/*
// @match        https://*/*
// @grant        none
// @license CC BY-NC-SA 4.0
// ==/UserScript==

(function() {
    'use strict';

    // Remove border-radius from all elements
    var elements = document.querySelectorAll("*");
    for(var i = 0; i < elements.length; i++) {
        elements[i].style.borderRadius = "0";
    }

        function setRadiusToZero(node) {
        if (node.style) {
            for (let prop in node.style) {
                if (prop.toLowerCase().includes("radius")) {
                    node.style[prop] = "0";
                }
            }
        }

        node.childNodes.forEach(child => {
            setRadiusToZero(child);
        });
    }

    setRadiusToZero(document.documentElement);

    // Remove background-image and border-radius from all images
    var images = document.querySelectorAll("img");
    for(var j = 0; j < images.length; j++) {
        images[j].style.backgroundImage = "none";
        images[j].style.borderRadius = "0";
    }

    // Remove any CSS classes with rounded styles
    var stylesheets = document.styleSheets;
    for (var k = 0; k < stylesheets.length; k++) {
        var rules = stylesheets[j].cssRules;
        for (var l = 0; l < rules.length; l++) {
            var rule = rules[l];
            if (rule.selectorText) {
                if (rule.selectorText.includes('border-radius') || rule.selectorText.includes('border-radius')) {
                    stylesheets[k].deleteRule(l);
                    l--;
                }
            }
        }
    }


        //Finds and sets all computed values containing the word "radius" to 0 in Flex containers and items.
      const allFlexContainers = document.querySelectorAll('*[style*="display:flex"], *[style*="display: inline-flex"]');
  const allFlexItems = document.querySelectorAll('*[style*="flex:"], *[style*="inline-flex:"]');

  allFlexContainers.forEach(flexContainer => {
    Array.from(flexContainer.style).forEach(styleProperty => {
      if (styleProperty.includes('radius')) {
        flexContainer.style[styleProperty] = '0';
      }
    });
  });

  allFlexItems.forEach(flexItem => {
    Array.from(flexItem.style).forEach(styleProperty => {
      if (styleProperty.includes('radius')) {
        flexItem.style[styleProperty] = '0';
      }
    });
  });







})();