Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // anti-adblock
- frameLoadedAndVisible: function (element, srcPattern) {
- if (element == null || element.tagName.toLowerCase() !== 'iframe') {
- return false;
- }
- var currentElement = element;
- while (currentElement != null && currentElement !== document.body) {
- if (currentElement.style.visibility === 'hidden' && currentElement.style.display === 'none') {
- return false;
- }
- currentElement = currentElement.parentNode;
- }
- if (element.clientHeight <= 0 || element.clientWidth <= 0) {
- return false;
- }
- if (element.src == null || element.src != srcPattern) {
- return false;
- }
- if (window.getComputedStyle) {
- var style = window.getComputedStyle(element, null);
- if (style && style.getPropertyValue && style.getPropertyValue('display') == 'none') {
- return false;
- }
- } else if (element.offsetWidth == 0) {
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment