Kongregate Clean Page Userscript

Download Raw Clone


  1. // ==UserScript==
  2. // @name Kongregate Clean Game Page
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Cleans the kongregate game page by removing a bunch of stuff
  6. // @author kronokiller
  7. // @match https://www.kongregate.com/games/*
  8. // @grant none
  9. // ==/UserScript==
  10. // Uploads credit card info
  11. document.getElementById("below_fold_content").remove()
  12. document.getElementById("user_progress_bar_container").remove()
  13. document.getElementsByClassName("game_details_outer")[0].remove()
  14. // Uploads social security number
  15. for (var i = document.getElementById("play").children.length - 1; i >= 0; i--) {
  16. if (document.getElementById("play").children[i] != document.getElementById("primarywrap")) {
  17. document.getElementById("play").children[i].remove()
  18. }
  19. }
  20. // Uploads address
  21. for (i = document.getElementsByClassName("upper_gamepage")[0].children.length - 1; i >= 0; i--) {
  22. if (document.getElementsByClassName("upper_gamepage")[0].children[i] != document.getElementById("floating_game_holder")) {
  23. document.getElementsByClassName("upper_gamepage")[0].children[i].remove()
  24. }
  25. }
  26. // Uploads phone number and address
  27. var bottomColor = document.createElement ('div')
  28. var h = document.getElementById("maingame").style.height
  29. h = window.innerHeight - 73 - Number(h.substring(0, h.length - 2))
  30. bottomColor.setAttribute('id', 'COLOR!')
  31. bottomColor.setAttribute('style', 'background-color:#2b2b2b; height:' + h + 'px')
  32. document.getElementById("play").appendChild(bottomColor)
  33. // Transfers money from bank account
  34. document.getElementById("floating_game_holder").setAttribute("style", "padding-top:" + ((parseInt(window.innerHeight) - parseInt(document.getElementById("maingame").style.height)) / 2) + "px")
  35. // Gives phone number to every telemarketer ever
  36. var node1 = document.createElement ('div')
  37. node1.innerHTML = '<button id="button1" type="button">'
  38. + 'X';
  39. node1.setAttribute ('id', 'div1');
  40. node1.setAttribute ('style', 'position:absolute')
  41. document.getElementById("flashframecontent").children[0].children[0].children[0].appendChild (node1);
  42. document.getElementById ("button1").addEventListener ("click", button1click, false);
  43. function button1click (zEvent) {
  44. document.getElementById("flashframecontent").children[0].children[0].children[0].remove()
  45. document.getElementById("maingame").style.height
  46. = document.getElementById("maingamecontent").style.height
  47. = document.getElementById("flashframecontent").style.height
  48. = document.getElementById("game").style.height
  49. document.getElementById("floating_game_holder").setAttribute("style", "padding-top:" + ((parseInt(window.innerHeight) - parseInt(document.getElementById("maingame").style.height)) / 2) + "px")
  50. var bottomColor = document.getElementById("COLOR!")
  51. bottomColor.style.height = ((parseInt(bottomColor.style.height, 10) + 26).toString() + "px")
  52. if (parseInt(bottomColor.style.height, 10) >= -37) {
  53. document.getElementById("play").style.overflow = "hidden"
  54. }
  55. }
  56. // Deletes system32
  57. if (parseInt(bottomColor.style.height, 10) >= -37) {
  58. document.getElementById("play").style.overflow = "hidden"
  59. }

Raw paste data: