您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Switches the charts to dark mode
// ==UserScript== // @name eToro - dark mode for charts // @namespace http://tampermonkey.net/ // @version 1.2.0 // @description Switches the charts to dark mode // @author Bartek Igielski // @match https://*.etoro.com/* // @match https://etoro.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=etoro.com // @grant none // @license MIT // ==/UserScript== (function() { function changeTheme() { const interval = setInterval(() => { if (!Object.keys(window).find(key => key.startsWith('tradingview_'))) { return } if (!document.querySelector('[data-widget-options]')?.contentWindow?.tradingViewApi?._activeChartWidget()?._inited) { return } clearInterval(interval) setTimeout(() => { document.querySelector('[data-widget-options]').contentWindow.tradingViewApi.themes().setStdTheme('dark') }, 500) }, 100) } function emitURLChangeEvent() { const event = new CustomEvent("urlChange", { detail: { url: window.location.href } }) window.dispatchEvent(event); } const originalPushState = history.pushState const originalReplaceState = history.replaceState history.pushState = function(...args) { originalPushState.apply(this, args) emitURLChangeEvent() }; history.replaceState = function(...args) { originalReplaceState.apply(this, args) emitURLChangeEvent() }; window.addEventListener("popstate", emitURLChangeEvent) window.addEventListener("load", emitURLChangeEvent) window.addEventListener("urlChange", changeTheme) changeTheme(); })();