Jump to content

nasekt

Members
  • Posts

    7
  • Joined

  • Last visited

nasekt's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. If TargetString is found in www.example.com/TargetString redirect to by picking a random URL from array list. Now, how do I tell javascript to NOT pick the already picked URL?
  2. I use [Fiddler](Understanding FiddlerScript ), Man in the middle proxy tool var regex = /TargetString/gi ;if (regex.match(URL) {var request_arr = new Array( "www.bing.com", "www.google.com", "www.yahoo.com", "www.sandbox.com");var random_url = request_arr[Math.floor(Math.random() * request_arr.length)]; Basically, The above code says, if the TargetString is found in URL, then redirect it to a random URL.What I need, For example:If TargetString is found in www.example.com/TargetString redirect to by picking a random URL from array list and NOT to use THAT URL in the futureThank you
  3. Thanks, is there any other way without using DOM to get the string? I am using Fiddler http://www.telerik.com/fiddler which runs on JScript.NET, It's a Man in the middle proxy. Some samples of what it can do, http://fiddlerbook.com/fiddler/Dev/ScriptSamples.asp
  4. How do I replace the string "rpg" only present in between <et> tags ? <et>ReplaceOnlyrpg</et> After replacement it should look like this <et>ReplaceOnly</et> Thank you
  5. I'm using Fiddler (web debugging tool) and the below code is JScript .NET, which is basically a .NET version of Javascript. if (oSession.HostnameIs("www.youtube.com") && oSession.oResponse.headers.ExistsAndContains("Content-Type","text/html")) // oSession is a Fiddler object session { oSession.utilDecodeResponse(); // Remove any compression or chunking oSession.utilReplaceInResponse('<b>','<u>'); // Search and replace in HTML } How do I replace youtube video player with this message? <div id="player-unavailable" class=" player-width player-height player-unavailable "> <div class="icon meh"></div> <div class="content"> <h1 id="unavailable-message" class="message"> This video is no longer available because of inappropriate content. </h1> <div id="unavailable-submessage" class="submessage">Sorry about that. </div> </div></div> Thank you
  6. In this case, Let's take Google Search as example:The code is JScript .NET, which is basically a .NET version of Javascript. Regardless of language, Anyone with appending type of skill can answer my question.This code is used in Fiddler(It's a Man-in-the-middle proxy) if (oSession.uriContains("&q=")) // oSession is a Fiddler object session // uriContains() function, checks for case-insensitive string from the URI{ var str = oSession.fullUrl; var sAppend = "test1+test2+test3"; if (!oSession.uriContains(sAppend)) { oSession.fullUrl = str.replace( "&q=","&q="+sAppend); }} For those who are confused, It says, If &q= is present in the URI, replace &q= with &q=test1+test2+test3Problem: It appends test1+test2+test3 instantly, when it sees &q= in the URL.Basically, how do I make it wait until I click the submit/search buttonThank you.Update: I heard about Onsubmit() event, but not really familiar with it. How do I use it? like, should I go to google source page and edit the form id?Also, Any other methods besides Onsubmit()?
  7. The code is JScript .NET, which is basically a .NET version of Javascript.Regardless of language, Anyone with appending type of skill can answer my questionThe problem is, when I keep issuing the request it keeps appending over and over again, http://i.imgur.com/nKCvgKn.png if (oSession.uriContains("search?q=")) { var str = oSession.fullUrl; var sAppend = "+test1+test2+test3"; if (!oSession.uriContains(sAppend)) { oSession.fullUrl = str.replace( "search?q=","search?q="+sAppend); }} Basically, how do I tell javascript to NOT replace when search?q=+test1+test2+test3 is already present in the URL? Can you please give me an example? I'm still new to programming.Thank you
×
×
  • Create New...