Filter Out $0.00 Garbage On Google Play Purchase History

Filter Out Free Stuff On Google Play Purchase History

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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';
    }
  }
}