Skip to content

Instantly share code, notes, and snippets.

@luyi985
Created May 25, 2017 04:38
Show Gist options
  • Save luyi985/3d1fd7a33649c149e6635ad37aff6ad7 to your computer and use it in GitHub Desktop.
Save luyi985/3d1fd7a33649c149e6635ad37aff6ad7 to your computer and use it in GitHub Desktop.
Script for Ad position value check
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