Question

So I'm trying to write a program that finds a java script function in a webpage (the page is written in java script) and a loop that runs the function until the user pushes a button.

I think the best way to write this is an add-on so it can have its necessary accesses to browser.

It must consist of two parts, first a block finder, something like easy filter in AdBlockPlus or block element in AdBlock+ which finds a java script function; and then a function that repeatedly runs the java script function that it found on the first step with a 500ms delay until the user tell it to stop, perhaps with a specific key.

I know the general but I haven’t got a clue how to start. And I only know how to program in c++. I’m not in a rush, I’ve got like 20 days but that’s not enough for trial and error so I had to ask you guys these questions.

My questions are:

Is it even possible to write the code with this algorithm?

Which browser should I choose for writing this add-on?

What I need to learn for writing this add-on?

Was it helpful?

Solution 2

For writing Chrome extensions, you really need to know javascript since all the moving parts will be written in javascript. You would also have to know html and css.

For a good starting point, you should checkout the info tab of google-chrome-extensions tag.

There you find a good amount of information to get you started.

For Firefox Extensions, you can either create xul based extensions, or with the new addon-sdk. You can see a chart with a comparison here.

In both of them you have to know javascript as well.

About what browser you use, i can't really choose it for you, but i hope i gave you enough information to choose for yourself.

OTHER TIPS

Okay, if you want to create a function that is executed every 500ms, you can use this HTML:

<BODY onload="time()"> ...

and this JavaScript:

timer = null;

function time() {
    check();
    window.setTimeout("check();", 500);
}

function check() {
    //do something
}

To stop the loop, use

<A ... onclick="window.clearTimeout(timer); return false"> ... </A>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top