Created
August 8, 2021 15:58
-
-
Save MaxiCom/940598256d52987a5ddc64ef9cbbc5cc to your computer and use it in GitHub Desktop.
(TAMPERMONKEY) freetetris.org NO ADS + FULLSCREEN V0.1
This file contains 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
// ==UserScript== | |
// @name freetetris.org NO ADS + FULL SCREEN | |
// @namespace Maxime Morlet | |
// @version 0.1 | |
// @description Remove ads and set fullscreen for freetetris.org | |
// @author You | |
// @match https://www.freetetris.org/game.php | |
// @icon https://www.google.com/s2/favicons?domain=freetetris.org | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let callback = function () { | |
let gameArea = document.querySelector('#gameIFrame'); | |
gameArea.style.position = 'absolute'; | |
gameArea.style.top = '0px'; | |
gameArea.style.left = '0px'; | |
gameArea.style.width = '100%'; | |
gameArea.style.height = '100%'; | |
gameArea.style.padding = '0'; | |
gameArea.style.margin = '0'; | |
} | |
let gameDivContainer = document.querySelector('#gameDivContainer'); | |
let bottomAds = document.querySelectorAll('.linkButtonT1'); | |
let config = { childList: true }; | |
let observer = new MutationObserver(callback); | |
observer.observe(gameDivContainer, config); | |
for (let i = 0; i < bottomAds.length; i++) { | |
bottomAds[i].parentElement.removeChild(bottomAds[i]); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment