Created
May 25, 2017 04:38
-
-
Save luyi985/3d1fd7a33649c149e6635ad37aff6ad7 to your computer and use it in GitHub Desktop.
Script for Ad position value check
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
setInterval(addLabelToAds, 1000); | |
function addLabelToAds() { | |
Array.from(document.querySelectorAll('.ad-pos-label')).forEach( x => { | |
x.parentNode.removeChild(x); | |
}); | |
Array.from(document.querySelectorAll("[id^='gpt-slot']")).forEach(x => { | |
var id = x.id; | |
var pos = x.getAttribute('class'); | |
var el = document.createElement('div'); | |
el.setAttribute('class', 'ad-pos-label') | |
el.setAttribute('style' , 'font-size: 50px; font-family: sans-serif; z-index: 100000; color: #fff; background-color: blue; position: relative; min-width: 100px; left: 0; top: 0;'); | |
el.innerText = `${pos}`; | |
x.appendChild(el) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment