javascript - How to access and click button of popup window? -


i working on adf.ly link bypasser using popup window have 1 problem problem if first goto adf.ly , run code google chrome console it's work if first don't goto adf.ly , run code in example google.com chrome window console it's stop working want click skip button without going adf.ly popup window skiper code below:

var newwindow = window.open("https://adf.ly/dkcdx"); newwindow.window.onload = function() {     newwindow.focus()     settimeout(function() {           if(newwindow.window.document.getelementbyid('skip_ad_button')){newwindow.window.document.getelementbyid('skip_button').click();;     }else{         //nothing     }     }, 8000);}; 

thanks.

your problem same-origin-policy. javascript in webpage can not access websites on domain.

this why working adfly page, not google.

an option implement skipper chrome extension, these can access allowed websites like.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -