2

Is it possible to log something in the console of another webpage? Below is a snippet of what I have so far:

function openWindowX() {
    var x = window.open("www.example.com");
}
function writeInConsoleX() {
    x.console.log(document.body.innerHTML = "new content");
}

But this doesn't always work. Am I doing something wrong, or is there a more efficient way to do this?

1
  • You should open URI at the same domain. Otherwise your code works fine. Jul 11, 2015 at 17:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.