Skip to content

Instantly share code, notes, and snippets.

@GitHubEmploy
Created October 14, 2024 21:44
Show Gist options
  • Save GitHubEmploy/7901ea25f4f74667a4e1d15c7c3711fb to your computer and use it in GitHub Desktop.
Save GitHubEmploy/7901ea25f4f74667a4e1d15c7c3711fb to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Modify Slider Max Value
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Change max value of a specific range slider
// @author Mohit
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Function to modify the slider max value
function modifySliderMax() {
const slider = document.querySelector(
'input#slider2.slider2[type="range"][name="camberSlider"][min="5.0"][max="37.79"][step="0.1"]'
);
if (slider) {
slider.max = "60";
console.log("Slider max value changed to 60");
}
}
// Run the function when the page loads
window.addEventListener('load', modifySliderMax);
// Monitor for changes in the DOM in case the element is loaded dynamically
const observer = new MutationObserver(modifySliderMax);
observer.observe(document.body, { childList: true, subtree: true });
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment