This user is suspected of being a cat. Please report any suspicious behavior.

    • RedWizard [he/him, comrade/them]@hexbear.net
      link
      fedilink
      English
      arrow-up
      9
      ·
      edit-2
      13 days ago

      Browser extension that looks for the text entry field on Hexbear and automatically pastes the text into the field if the field is blank. Or you could use something like tamper monkey to run the JS code without needing an extension. It wouldn’t be too dissimilar to the extension that does a text replace. You’d be looking for this:

      <textarea 
          class="form-control border-0 rounded-top-0 rounded-bottom" 
          id="markdown-textarea-Nz0qXtBTCHwM9wcFomEu" 
          required="" 
          rows="2" 
          maxlength="10000" 
          placeholder="Type here to comment..." 
          spellcheck="false" 
          style="overflow: hidden; overflow-wrap: break-word; resize: none; text-align: start; height: 60px; line-height: 24px;" 
          data-tribute="true" 
          data-lt-tmp-id="lt-64348" 
          data-gramm="false">
      </textarea>
      

      Probably want to search for the node with the markdown-textarea- ID, since that should be true for comments and posts. So you can do something like this:

      var sigHR = "\n\n---\n"
      var sigMessage = "ⓘ _This user is suspected of being a cat. Please report any suspicious behavior._"
      var sig = `${sigHR}${sigMessage}`
      
      var elements = document.querySelectorAll('[id^=markdown-textarea-]');
      // this gets all elements that have an ID which starts with markdown-textarea-
      
      for (element of elements) {
          if (element.value === "") {
              element.value += sig
          }
      

      Then you would use the same observer code that you used to find and replace text to check if the page changes, and run that code above when it does. So if you click to create a new comment somewhere else in the page, and it spawns the textarea, it should add the text for you automatically.

      You could eventually expand this idea to an extension that when clicked presents a page with a forum that allows you to submit and store your sig. So, if you ever want to change it, you don’t have to edit the code to do so.

      • Besides your newlines being the wrong way around. This was very helpful! I made this violentmonkey script:

        // ==UserScript==
        // @name        hexbear signature
        // @namespace   Violentmonkey Scripts
        // @match       https://hexbear.net/*
        // @grant       none
        // @version     1.1
        // @author      Edie
        // @description 29/12/2025, 18.08.13
        // ==/UserScript==
        
        var sigHR = "\n\n---\n"
        var sigMessage = "ⓘ *This user is suspected of being a cat. Please report any suspicious behavior.*"
        var sig =  `${sigHR}${sigMessage}`
        
        function addSig(node) {
          var element = node.querySelector('[id^=markdown-textarea-]')
          if (element != null) {
            if (element.value === "") {
              element.value = sig
            }
          }
        }
        
        const observer = new MutationObserver(records => {
          records.forEach(record => {
            for (const addedNode of record.addedNodes) {
              if (addedNode.nodeType == 1) {
                addSig(addedNode)
              }
            }
          })
        });
        
        observer.observe(document.body, {
            subtree: true,
            childList: true
        });
        
        addSig(document)
        
        

        Edit: Updated to version 1.1!


        This user is suspected of being a cat. Please report any suspicious behavior.