Filter Out $0.00 Garbage On Google Play Purchase History

Filter Out Free Stuff On Google Play Purchase History

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Filter Out $0.00 Garbage On Google Play Purchase History
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Filter Out Free Stuff On Google Play Purchase History
// @author       SwanKnight
// @match        https://play.google.com/store/account/orderhistory*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant        none
// @license     GPLv3
// ==/UserScript==

(function() {
    const MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
    const observer = new MutationObserver(hideZeroElements);
    // tried with div elements but does not seem to work.
    observer.observe(document.body, {
        subtree: true,
        childList: true,
        attributes: false
    });
})();

function hideZeroElements(mutations, observer) {
var ele = document.getElementsByClassName('mshXob');
  for (var i = 0; i < ele.length; ++i) {
    var item = ele[i];
    if (item.innerHTML == '$0.00' || item.innerHTML.includes('0.000')) {
      var gp = item.parentNode.parentNode.parentNode;
      gp.style.display = 'none';
    }
  }
}