您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Enables the hidden "dark mode" theme for the Chart on Oanda's web trading platform.
// ==UserScript== // @name Oanda.com Trading Platform - Enable Chart Dark Theme // @namespace http://tampermonkey.net/ // @version 1.0 // @description Enables the hidden "dark mode" theme for the Chart on Oanda's web trading platform. // @author FreshScripts // @match https://trade.oanda.com/ // @grant CC BY - Creative Commons Attribution // ==/UserScript== (function() { 'use strict'; console.log('Bypassing browser warning...'); var button = document.querySelector('.button button'); button.click(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.type !== 'childList') return for (var i = 0; i < mutation.addedNodes.length; i++) { // do things to your newly added nodes here var thisNode = mutation.addedNodes[i]; if (thisNode.nodeName === 'IFRAME'){ thisNode.onload = function() { console.log('iframe is completely loaded, setting theme to Dark'); thisNode.contentWindow.document.getElementsByTagName('html')[0].classList.add('theme-dark'); // stop watching using: observer.disconnect() } } } }) }) observer.observe(document.body, { childList: true, subtree: true, attributes: false, characterData: false }) })();