Remove PNL value.

Removes the PNL value to prevent emotional trading.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Remove PNL value.
// @namespace    https://www.binance.com/
// @version      0.2
// @description  Removes the PNL value to prevent emotional trading.
// @author       @Pierre_Le_Guen
// @match        https://www.binance.com/*
// @grant        none
// ==/UserScript==

const checkElement = async selector => {
  while ( document.querySelector(selector) === null) {
    await new Promise( resolve => requestAnimationFrame(resolve) )
  }
  return document.querySelector(selector);
};

(function() {
    'use strict';

    console.log("Remove PNL value v0.1 - MOON or DOOM");

    checkElement('.pnl').then((selector) => {
        var config = { attributes: true, childList: true, characterData: true, subtree: true };

        var callback = function(mutationsList) {
            if (mutationsList[0].target.textContent.includes("-")) {
                selector.firstChild.innerHTML = "";
            } else if(selector.firstChild.innerHTML != "TO THE MOON" && selector.firstChild.innerHTML != "") {
                selector.firstChild.innerHTML = "TO THE MOON";
            }
        };
        var observer = new MutationObserver(callback);
        observer.observe(selector, config);
    });
})();