Search code examples
javascriptgoogle-chromegreasemonkeyuserscriptstampermonkey

Userscript works in Greasemonkey/Violent monkey, but not Tampermonkey


I made a userscript that is supposed to change the selected content of a select box:

// ==UserScript==
// @name         Automatic Selection Chooser
// @namespace    eScripts
// @version      0.1
// @description  Automatically chooses a selection from a select tag
// @author       Essem
// @match        *CENSORED DUE TO THE WEBSITE'S TERMS OF SERVICE*
// ==/UserScript==

var element = document.getElementById('Database');
element.value = "940";

Explanation: Database is the ID/Name of the select tag, while 940 is the value of the option tag.

Whenever I run it in Firefox w/ Greasemonkey, it runs flawlessly. However, when I run it on Chrome w/ Tampermonkey, it doesn't change the box at all. I thought that this was a Chrome issue, which it very well might be, but I ran an alternative with Chrome, Violent monkey, and it worked! Any ideas to make it work on Tampermonkey?


Solution

  • This is apparently a bug with Tampermonkey, as I found out that it does actually select the option; it just doesn't show the option on the textbox next to it. I will try to reach out to the devs about this issue.