I write a small greasemonkey script to open links at this typehttp://example.com/details.php?id=*&very=1
and click a hello
button at those link, but somehow it can't work
// ==UserScript==
// @name My Fancy New Userscript
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @include http://example.com/details.php?id=*&very=1
// @copyright 2012+, You
// ==/UserScript==
function sayhello(){
for(var i=1;i<100;i++){
window.location.href='http://example.com/details.php?id='+i+'&very=1'
$(#hello).click()}
}
};
sayhello();
But it does not work as my expection. And since the new href fit the include
rules, it will always load and load...
I rewrite it to:
function sayhello(){
var i=window.location.href.match(/d+/)
j=Number(i)+1
window.location.href=window.location.href.replace(/d+/, j);
$(#hello).click()
};
sayhello();
It works slowly since every time it will load the whole new page and sometimes if something in a page do not load correctly it will just stay on that page waiting and loading and then crash.
How to just skip the can not load correctly pages and guarantee the script running?
And how to speed it up, i just need to click a specific button ,not need to load the pictures or the other stuff.
Anyone can help?
Thanks.