Results 1 to 1 of 1

Thread: Javascript in Vb.net

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    71

    Javascript in Vb.net

    Hey everybody,

    I am trying to add some Javascript code into a VB.net webbrowser. I am not sure how I would do this. The code is for a Firefox Grease monkey script.

    Here it is:
    Code:
    // ==UserScript==
    // @name Just say NO!
    // @namespace http://schoolsux.tz/
    // @description Checks no on surveys, just enable whenever you need it; you should edit the @include.
    // @include http://www.eltpath.com/*
    // @include http://*.smileymedia.com/*
    // @include http://lgn*.coolsavings.com/*
    // @include http://lnktrckr.com/*
    // @include http://*quizjungle.com/?act_id=*
    // @include http://www.quizjumper.com/*
    // @include http://www.modpath.com/*
    // @include http://www.tnmtechnology.com/*
    // @include http://www.brandarama.com/*
    // @include Theuseful
    // @include http://offers.slwpath.com/*
    // @include Fun Personality Quizzes and Fun Tests Online - Quiz Rocket!
    // @include http://www*.recipe4living.com/default*
    // @include Theuseful
    // @include https://mysmokingrewards.com/*
    // @include http://www.eversave.com/*
    // @include http://www.thelaptopsaver.com/*
    // ==/UserScript==
    
    inputs = document.getElementsByTagName("input");
    var checkedyes = 0;
    var radios=0;
    var firstradio=0;
    var foundradio=false;
    var i=0;
    for(i=0;i<inputs.length;i++)
    {
    if(inputs[i].type=="radio")
    {
    if(!foundradio)
    {
    firstradio = i;
    foundradio = true;
    }
    radios++;
    if(inputs[i].value.toLowerCase()=="no")
    {
    inputs[i].checked = true;
    inputs[i].click();
    document.body.focus();
    }
    else
    {
    inputs[i].checked=true;
    }
    }
    
    }
    if (radios>2)
    {
    inputs[firstradio+2].checked=true;
    }
    
    next = document.getElementById("nextOffer");
    if (next == null)
    {
    next = document.getElementById("pass");
    }
    if (next == null)
    {
    next = document.getElementById("bt_cancel");
    }
    if(next == null)
    {
    for(i=0;i<inputs.length;i++)
    {
    if((inputs[i].type=="submit") && (inputs[i].value.toLowerCase()=="skip"))
    {
    next = inputs[i];
    break;
    }
    }
    }
    if(next==null)
    {
    for(i=0;i<inputs.length;i++)
    {
    if((inputs[i].value.toLowerCase()=="submit") || (inputs[i].name.toLowerCase()=="submit"))
    {
    next = inputs[i];
    break;
    }
    }
    }
    if(next == null)
    {
    next = document.getElementById("submitbutton");
    }
    next.focus();
    next.click();
    Any help would be much appreciated.
    Last edited by VisualBasic2008; Oct 18th, 2009 at 06:52 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width