Created
July 6, 2018 17:28
-
-
Save allenday/03548426d1e7dd79bf472fd5a2a9ea54 to your computer and use it in GitHub Desktop.
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
| window.addEventListener("blur",function(){ | |
| window.setTimeout(function(){ | |
| var outerIframe = document.activeElement; | |
| if (! outerIframe instanceof HTMLIFrameElement) { console.log("fail 1");return } | |
| if (outerIframe.id.match("google_ads") == null) { console.log("fail 2");return } | |
| var innerDoc = outerIframe.contentWindow | |
| ? outerIframe.contentWindow.document | |
| : frameRef.contentDocument; | |
| var innerIframe = innerDoc.getElementsByTagName('iframe')[0]; | |
| if (innerIframe == null) { console.log("fail 3");return } | |
| var innerSrc = innerIframe.getAttribute('src'); | |
| if (innerSrc == null) { console.log("fail 4");return } | |
| var clickURL = getParameterArrayByName("click_url",innerSrc); | |
| if (clickURL == null) { console.log("fail 5");return } | |
| console.log("fetching tracking URL: "+clickURL); | |
| fetch(clickURL); | |
| },0); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment