Strava Button Clicker [For Use Convert Ascent and Descent to Feet][ELevate / Sauce Users]

Clicks the button to fetch the Ascent and Descent values in meters for use with the Convert Ascent and Descent to Feet script.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Strava Button Clicker [For Use Convert Ascent and Descent to Feet][ELevate / Sauce Users]
// @namespace    typpi.online
// @version      1.2
// @description  Clicks the button to fetch the Ascent and Descent values in meters for use with the Convert Ascent and Descent to Feet script.
// @author       Nick2bad4u
// @match        https://www.strava.com/activities/*
// @resource     https://www.google.com/s2/favicons?sz=64&domain=strava.com
// @icon         https://www.google.com/s2/favicons?sz=64&domain=strava.com
// @icon64       https://www.google.com/s2/favicons?sz=64&domain=strava.com
// @grant        none
// @run-at       document-end
// @homepageURL  https://github.com/Nick2bad4u/UserStyles
// @supportURL   https://github.com/Nick2bad4u/UserStyles/issues
// @license      Unlicense
// @note         This is for use with: https://update.greasyfork.org/scripts/520655/Convert%20Ascent%20and%20Descent%20to%20Feet.user.js
// ==/UserScript==

(function () {
  'use strict';

  // Run 5 seconds after the page finishes loading
  setTimeout(() => {
    // Select the button by its ID
    let button = document.querySelector('#extendedStatsButton');
    if (button) {
      button.click();
      console.log('Button clicked.');

      // Close the popup after 3 seconds using the Escape key
      setTimeout(() => {
        let event = new KeyboardEvent('keydown', {
          key: 'Escape',
          code: 'Escape',
          keyCode: 27,
          which: 27,
          bubbles: true,
        });
        document.dispatchEvent(event);
        console.log('Popup closed.');
      }, 3000);
    } else {
      console.error('Button not found. Please ensure the selector is correct.');
    }
  }, 5000);
})();