Remove New Comment Dropdown Menu Item

22/02/2024, 10:05:11

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

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

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

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        Remove New Comment Dropdown Menu Item
// @namespace   Eliot Cole Scripts
// @match       https://make.powerautomate.com/*
// @grant       none
// @license MIT
// @version     1.2
// @author      Eliot Cole
// @description 22/02/2024, 10:05:11
// @require     https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
// @require     https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
// ==/UserScript==


// This is here as I might make the 'li' selector more precise in the future
// #ms-ContextualMenu-item[role="presentation"]

VM.observe(document.body, () => {
  const $node = $('li:has( > button[name="New Comment"]');

  if ($node.length) {

    $node.each(function(){
      $(this).css('display', 'none');
    });

    // // disconnect observer - This is disabled as if you disconnect you cannot enter more comments
    // return true;
  }
});