0

The website

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>


</body>
                <script>
                        function e(q){eval(q)}
                </script>
</html>

If i go to the website and write javascript:e("alert()") function e will be executed but stuff like http://website.com/javascript:e("alert()") will not work i ther a way to execute the function e from another website?

eyal
  • 107
  • 1
  • 7
  • You have to load the website for the JS on it to load. But it might be put in an iframe or something. It would help if you clarify why you want this information. – VLAZ Sep 14 '21 at 09:32
  • 1
    The JavaScript execution on Websites is protected on several levels. Injecting code isn't that easy (anymore). [This question](https://stackoverflow.com/questions/25845203/understanding-cors) may help you. – Christopher Sep 14 '21 at 09:37
  • 1
    Also very relevant: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy – Teemu Sep 14 '21 at 09:43

0 Answers0