[TUTORIAL]How to run a "Javascript" on web browsers and monitor the requests.

D

Deleted member 658642

Guest
Do you have a "Javascript" or a .js file that requires execution but you don't know how?

Well you've come to the right place. In this tutorial I will be showing all of you how to run a "Javascript" in a web browser like chrome, safari, opera etc and monitoring the requests with fiddler.

Steps to follow :-

1) Make a sample html document like the following :

Code:
<!DOCTYPE html>
<html>
<body>
[B][SIZE=4]
YOUR JAVASCRIPT HERE!!!!

[/SIZE][/B]</body>
</html>

2) Enter your Javascript which usually starts with "<script type='text/javascript'>" and ends with "</script>" in the area mentioned as "YOUR JAVASCRIPT HERE!!!!". You must not forget the "<script type='text/javascript'>" and the "</script>" or the "Javascript" will not execute properly.

3) For this exact purpose, I will be using a YouTube views script as an example. Don't bother trying it out to get views as it's already patched.

Ex :-

Code:
<!DOCTYPE html>
<html>
<body>
<script type='text/javascript'>
function rS(len) {
    var ch = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
    var ret = '';
    for (var i = 0; i < len; i++) {
        var rnum = Math.floor(Math.random() * ch.length);
        ret += ch.substring(rnum, rnum + 1);
    }
    return ret;
}




//VIDEO_ID
var docid='ym2TbhtXRUQ';
//Lenght seconds
var len=30;
//Random rt + Lenght seconds
var rt=Math.floor(Math.random() * 20) + len;




for(var i=0;i<4;i++){
 //plid
 var plid=rS(16);
 document.write('<script type="text/javascript" src="http://video.google.com/s?docid='+docid+'&app=youtube_gdata&ns=yt&len='+len+'&el=embedded&ps=android&rt='+rt+'.0&plid='+plid+'&av=2516_10&sw=0.1&playback=1&st=0.0&et='+len+'&sourceid=y&eurl=http://twitter.com/&fmt=18"><\/script>')
}




</script>
</body>
</html>

4) Now the save the file as "whatsover.html" or "whatsoever.htm".

5) Right - Click on the file and open with "Chrome" or any other browser.

6) Before you do that be sure to keep fiddler open to monitor the web requests.

Voila, you're done! The same method can be applied if you want the "Javascript" to run on a blog or a website.
Cheers,
RushingWind.
 
Erm I'm not sure I get you :)

Ctrl + shift + k - in my Firefox version :)

But I don't really understand all the hassle. JavaScript is meant to be executed by your browser. How else would you execute it? And how/why would you write a JavaScript script if you didn't knew how to execute it? And last, you don't even need the HTML tags, so how does this tutorial help anyone?
 
Last edited:
Ctrl + shift + k - in my Firefox version :)

But I don't really understand all the hassle. JavaScript is meant to be executed by your browser. How else would you execute it? And how/why would you write a JavaScript script if you didn't knew how to execute it?

This tutorial is not for those who write js but those who download javascripts and don't know how to execute it.
 
I am talking about testing. Suppose you have a client's site which you don't yet have access to, or you are testing out a function which is not working properly because you did not bind it to a browser event. In these cases, you can directly run the javascript from your console. I use firebug by the way.
Ctrl + shift + k - in my Firefox version :)

But I don't really understand all the hassle. JavaScript is meant to be executed by your browser. How else would you execute it? And how/why would you write a JavaScript script if you didn't knew how to execute it?
 
I am talking about testing. Suppose you have a client's site which you don't yet have access to, or you are testing out a function which is not working properly because you did not bind it to a browser event. In these cases, you can directly run the javascript from your console. I use firebug by the way.

Oh, that's a good suggestion. :)
 
I am talking about testing. Suppose you have a client's site which you don't yet have access to, or you are testing out a function which is not working properly because you did not bind it to a browser event. In these cases, you can directly run the javascript from your console. I use firebug by the way.

I see. I just wanted to help some newbies.
Cheers :)
 
Back
Top