Remove Rounded Corners

Remove all rounded corners from web page elements

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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';
      }
    });
  });







})();