1

I have the button linked with the comment being pasted but, I can't for the life of me figure out how to click the submit button then after it submits it should click the favorite button. But it doesn't.

I've tried a bunch of different things including document.GetElementsbyTag() and all of those different variations. None of them worked. The website is https://www.furaffinity.net/view/* and all the sub domains after this.

The goal of the script is to, once you click a button, paste a line of text into the comment box then submit the comment by clicking the button. After this happens it needs a delay to then click the "+Add to Favorites" link just below the post image/text. I just have 0 idea how to do all this since ive barely ever used JS for greasemonkey before.

Here's all of my script.

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.furaffinity.net/view/*
// @grant        none
// ==/UserScript==
    function addButton(text, onclick, cssObj) {
        cssObj = cssObj || {position: 'absolute', bottom: '7%', left:'4%', 'z-index': 3}
        let button = document.createElement('button'), btnStyle = button.style
        document.body.appendChild(button)
        button.innerHTML = text
        button.onclick = onclick
        Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key])
        return button
    }

(function(){
    'use strict'

  window.addEventListener('load', () => {
    addButton('Comment and Favourite!', gfg_Run)
    })

      var el_down = document.getElementById("JSMessage");
        var inputF = document.getElementById("JSMessage");
     function gfg_Run() {
            inputF.value = "Very Nice!";
            el_down.innerHTML =
                   "Value = " + "'" + inputF.value + "'";
          }
}())
FerretPaws
  • 83
  • 11
  • 1
    Please provide code samples of what you have tried and what your script looks like now. You are likely to get a better response. – dbinott Sep 25 '19 at 18:01
  • You need to post a [mre] and/or a link to the site, Plus at least a detailed illustration of your ideal outcome; Plus what you have tried and in what way it did not work. – Brock Adams Sep 25 '19 at 18:12
  • I've edited the post. – FerretPaws Sep 26 '19 at 11:53
  • @Legacy2988, Use a [comment reply](https://stackoverflow.com/help/privileges/comment), so that the person you are addressing sees the comment (we don't always recheck questions otherwise). Also, techniques like in [the linked question](https://stackoverflow.com/questions/15048223/choosing-and-activating-the-right-controls-on-an-ajax-driven-site) may still be required. – Brock Adams Sep 27 '19 at 04:35

0 Answers0