when you visite a website,the browser will fetch necessary resource like html, css and js.Then, the browser will resolve html, execute js code... I wonder if I can change the behavior of the website by inserting a custom JS fragment into the JS file fetched from the server before the browser executes the JS code?
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<script>
// Here goes your JS code
</script>
</head>
<body>
The content of the document
</body>
</html>