Last active
August 29, 2015 14:19
-
-
Save elken/15619b9be342db1266fe to your computer and use it in GitHub Desktop.
CSGO Trade Counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orig = "These are the items you will lose in the trade."; | |
var total = 0; | |
document.querySelector(".offerheader").childNodes.item(4).data = orig + " Total: " + total; | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
var url = document.querySelector(".nextTarget").childNodes.item(1).innerHTML.split(" ").slice(2); | |
if (url.length != 0) { | |
total = Number(document.querySelector(".nextTarget").id.split("_").slice(2)) + 1; | |
document.querySelector(".offerheader").childNodes.item(4).data = orig + " Total: " + total; | |
} | |
}); | |
}); | |
var node = document.getElementById("your_slots"); | |
observer.observe(node, { | |
attributes: !0, | |
attributeFilter: ["class", "src"], | |
attributeOldValue: true, | |
subtree: true | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment