Auto F5 reload window

By paulonkey Last update Aug 23, 2010 — Installed 18,785 times.

Suggestions and ideas welcome!

in
Subscribe to Suggestions and ideas welcome! 32 posts, 11 voices



paulonkey Script's Author

Hey people,

my code is quite ugly and defenitely too long-winded. I would prefer not to have to intercept all mouseclicks to check if any of my buttons is clicked. I guess there is a much better way to do than injecting JS and afterwards intercepting mouseclicks. So everyone with suggestions is very welcome.

Greets,
Paulonkey

 
PotatoHead User

Hi,
can't configure your Script?! Nothing happens after installing and pressing "Shift+T"!
Only the search Tab opens...

Whats wrong?

 
paulonkey Script's Author

Hey PotatoHead,
i´m not sure about this. If i hit "shift + t" with my script deactivated, nothing happens. maybe you have a hotkey for search tab, which overwrites the keycombination of the script. you could change the key in the sourcecode (search for "event.charCode == 84"). charCode == 84 is ascii. so you can chage it easyly to any number between 65 (=A) and 90 (=Z)(alphabetical order) for "shift + s" hotkey e.g. charCode == 83. if this doesn´t work. ask again! and i will try me best, to fix it. And if it works, would be good to know aswell...

i will try to make the hotkey configurable anyways, but this will take a little bit.

greetz,
paul

 
b10nutz User

don't know what happen but i have the same problem...... i used your previos version of the script and was working great... but now i can't configure to.. i try to change event.charCode == 84 still nothing happens.....

thank you

 
PotatoHead User

Hi,
the default Hotkey for searching in FF is "Ctrl+F" and i didn't change it, but if you press any key in a active FF window the search tab will also be open by default (try it ;-) ).
Also changing the ascii Code to another alphabetical letter didn't help.
How can I change the first Key from "Shift" to i.e. "Ctrl" oder "Alt"?
I found in the code the following:
"...if (!event.shiftKey || event.metaKey || event.altKey ||..."
Can i change here from "shiftKey" to "altKey"? I think it is not so easy, but maybe this should be a possible solution.

 
paulonkey Script's Author

Hey PotatoHead,

ok i understand now what you mean. In my FF search is only activated with ctrl + F. I will upload a new version right now. Please try it. I hope it´s done then. Yes you can change the hotkey to altkey. I hope it´s not necessary though :)

paul

 
paulonkey Script's Author

I´m afraid the "new" script is not the answer :(
there was just a ";" missing. But I have a clou. Seems to be a problem with the minutes format...
I hope to solve this today. Thanks for telling me that there is a problem: nothing worse than a scipt that is not working...

@PotatoHead: the script is working for me. And it´s quite hard to debug a working script ;)
So if it is still not running: tell me. I´ve activated the immediate search when press any key. With this at least the config menu is shown, even if it is then not hided again, it works.

Paul

 
PotatoHead User

Thanks too for your fast answer and for the will to solve the problem.

 
paulonkey Script's Author

Hey PotatoHead,
so is it working or not? As I understand your words i guess not...
Could you tell me which older version works correctly?
So I can start from there to search for possible reasons.

P.

 
paulonkey Script's Author

I think I found sth.:
my script seems to have problems with &. in the URL. Could you guys try to reproduce this by using a URL with and without &? I guess it could be that javascript treats & as & amp; or something like that...

Please post your results here, that would be great.
Paul

 
PotatoHead User

Still cant open the menu...

 
paulonkey Script's Author

Could you tell me the URL you are using the script on?
Did you try using it (just for tests) with google.com?
I´ve posted it in the forum. Maybe there is any help
available...

I guess the code grew too fast, now its hard to find
bugs. Hope getting a solution quickly!

 
paulonkey Script's Author

Hey Potato,
there is another explanation for a possible malfunction:
if the webpage is based on framesets, it is impossible to
show the menu, because it is a floating div. The script
keeps working, but not the config menu...

Please check your site concerning framesets. I´ll keep
searching for other reasons.

 
PotatoHead User

Hi,
i think i have it.
First I must activate the script over the "administrate userscripts" menu by clicking on the monkey (not sure how this menu called in english, i'm using the german version). But i think this is not the point...
Second, and that's the point, the script works only in new tabs, after activating the script.

That's all... ^^

 
PotatoHead User

Addition:
The menu works after deactivating the script, too.

 
paulonkey Script's Author

Hey Potato,
hehe. Good to solve the problem this way :)

paul
PS: greasemonkey scripts work, once activated, until the page is reloaded. this is nothing special of my script, but common to all GM scripts. try it ;)

 
ProInstall User

Can you make the script to load external URL from some input box not from browser and then reload it?

And one bug i found. When the time is set to 0:01 there is no chance to call the menu.

 
paulonkey Script's Author

Hey ProInstall, ok I think I get now what you mean: the input box could be an application or maybe a file, which my script can access to? I think this would work with lets say a .txt file. But I doubt that Firefox and especially GM can access to other applications. The filesystem in contrast is accessible. Is that what you want?

And the bug is true. I´m not sure if there are people who need to refresh every second, but in the worst case it can be changed in the about:config menu of firefox. Maybe I will check the input of timeout and ask "are you sure?" ;)

Paul

 
Chr1stian User

Thanks for the script.
It works perfectly, exept for one game that i play.
The "menu" looks like shit and it only updates one time.
Here you can se a ScreenShot of the menu while in the game:
http://tinypic.com/view.php?pic=2cnujx5&s=5

What i want for the script is to update every 3 second. I fill inn a number inn that game and klikk go, i want the script do do/update that action untill it appears an "antiBOT/Script" where i have to klikk 3 car out of 9 pics to continue. Is there any possibility of doing that?
Or at least have the script working normaly on that page..?

Christian =D

 
paulonkey Script's Author
Hey Chr1stian, thats true, that the menu depends on the css of the site. I´m working on that, but it will take time :( There is only one way to do that and it is not too easy...a workaround for that:
If you are running my script only on the nordicmafia site:
  • change in line 99 or whereever "option_box.innerHTML" stands the value "background:#EEF;" to "background:#000;"
if you are running my script on many sites:
  • install the script a second time under a different name (change @name in the script BEFORE installing) and change in line 99 or whereever "option_box.innerHTML" stands the value "background:#EEF;" to "background:#000;". Then change greasemonkey options to run this script ONLY on your page (in "include" paste your URL and in exclude put "*"). Then exclude the original script from that site the same way to avoid problems.
And "repeating action" is not what my script does. It *should* reload every x seconds. If this is not working, give me the URL (but as far as i could see, nordicmafia is only in norwegian and i don´t understand it).

If you want the script to submit a post or something similiar you should modify my script. As i cant effort the time to write personal scripts :) Tell me if this helps, otherwise tell me too :P

Paul
 
Chr1stian User

I found an other F5 script that works on the page. So I won't bother change in the script. Dont even know where to do it :/

Anyways, thanks for helping :D

 
paulonkey Script's Author

Hey Chr1stian,
thats good. Sorry I couldn´t help you, but as you found something else, everybody is happy ;)

Paul

 
nodws User
FirefoxWindows

hello
im interested in a script that does the refresh of a certain webpage, at some interval ...
but i would also need a buton or shortcut key to stop/disable the refresh/reload process
is that possible with your script or how could one do that? :D
thank you
BR

 
paulonkey Script's Author
FirefoxWindows

hey nodws/BR,
this should be possible. but as i don't have time to do this good, here is a quick&dirty solution (which i haven't tested!):
i hope it works :D
insert this code between the last line of the code:
but first change the "84" by the ascii character you want (see here for ascci values if you dont know them: http://en.wikipedia.org/wiki/ASCII#ASCII_printa....
84 = T by the way is not good ;)

if (event.charCode == 84) {
if(typeof(timeout_countdown)!='undefined'){
window.clearTimeout(timeout_countdown);
}
if(typeof(statusbar_timeout_countdown)!='undefined'){
for (var i=0;i<=statusbar_timeout_countdown.length;i++){
window.clearTimeout(statusbar_timeout_countdown[i]);
}
}
/* show abort message */
window.status=statusbar_stop_refresh[lang];

/*remove the values in the about:config */
timeoutset=false;
timeout=default_timeout;
GM_deleteValue('timeoutset'+thepage);
GM_deleteValue('timeout'+thepage);
obox.style.visibility='hidden';
}
}

 
elspeth User
FirefoxWindows

Just to let you know - this works with Flock (since you said "only tested in Firefox). :)
Thanks for the script!

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel