360haven works best with JavaScript enabled
Auto-Reload Window (GreaseMonkey UserScript)
Loading
Register
Results 1 to 1 of 1
  1. #1
    DEADBEEF

    JizzaBeez is offline
    Join Date : Nov 2010
    Posts : 777
    Array

    Auto-Reload Window (GreaseMonkey UserScript)

    This is a little Script that I wrote for the Firefox add-on "GreaseMonkey". It is used to auto-reload (refresh) any open Windows in the browser after a set interval.

    How to install a GreaseMonkey UserScript:

    (1) First, if you don't have it then you'll need to download and install the Firefox add-on "GreaseMonkey". It is very useful and is used for running scripts in the browser to modify webpages, etc.

    (2) Then once it's installed you should have a button for it in Firefox's NavBar or somewhere (depends on what version FF you have). Locate the button and click the arrow next to the monkey for a context menu with options, then select "New User Script...".

    (3) Then you should get a window where you are to fill in the information - Name, Namespace, Description, Includes and Excludes. This MetaData is optional and more or less can be added later. You can search GreaseMonkey's site or other places for more information on this. But in this example you only need to enter the Name, so call it "Auto-Reload Window".

    (4) Once the information is entered then press "OK" and it installs the script and opens the new script in Notepad for you to edit it.

    (5) Go ahead and DELETE ALL OF THE TEXT and then you will replace it with the following JavaScript:

    *Note: when separating the tags and the values in the MetaData it looks better to use a couple of "TAB" keys like: "// @name [TAB][TAB] Auto-Reload Window", but for some reason the code box here wasn't having it and they didn't stay in-line.. :(

    Code:
    // ==UserScript==
    // @name            Auto-Reload Window
    // @namespace        http://www.360haven.com
    // @version            1.0.0.0
    // @author            JizzaBeez
    // @description        Auto-Reload the Window at an interval of 60 seconds.
    // @include            http://*
    // @include            https://*
    // ==/UserScript==
    
    //Register GreaseMonkey Menu Command:
    
    GM_registerMenuCommand("Reload Window", window.location.reload);
    
    
    //Add Window Event Listener:
    
    window.addEventListener("load", reloadWindow, false);
    
    
    //Set the Window to Auto-Reload onload:
    
    window.onload = reloadWindow();
    
    
    //Function to Set a Timeout and then Reload the Window:
    
    function reloadWindow()
    {
        window.setTimeout(window.location.reload, 60000);
    }
    (6) As you can see, the code is very simple. I have it to Register a GreaseMonkey Menu Command (optional) and then a function to reload the window. Once replaced, SAVE THE FILE and then you can close it.

    (7) Now when you open a page/window in the browser the page will auto-reload (refresh) after 60 seconds. The script can be disabled/enabled by going back to the GreaseMonkey button and click the arrow (like before) and where you see "Auto-Reload Window", just click it to enable/disable. You will also see that in that menu where it says "User Script Commands..." there will be an option to "Reload Window", by clicking it will reload/refresh the window.

    (8) If it's working then you have just successfully installed a new UserScript! Many UserScripts can be found at http://userscripts.org/. Just be cautious of what you install because there are some malicious ones that can steal your information!

    *Note: GreaseMonkey has to be enabled in order for any scripts to run.

    I have attached this file below. It will be named "auto-reload_window.user.js". All UserScripts must be in JavaScript and the file must be named ending with ".user.js". If you create a New User Script through GreaseMonkey like I explained then you don't have to worry about creating the file and putting it in the correct directory because GreaseMonkey will do it for you, so you can always just let GreaseMonkey create the New User Script and then open it in GreaseMonkey to edit it.

    Have fun and happy Scripting!
    Attached Files Attached Files
    Last edited by JizzaBeez; 05-25-2011 at 10:47 PM.


  2. The Following 2 Users Say Thank You to JizzaBeez For This Useful Post:


 

 

Similar Threads

  1. [YouTube] Forza 6 Release Window Confirmed by Microsoft
    By THUMBS in forum Youtube Famous
    Replies: 0
    Last Post: 02-24-2015, 06:38 PM
  2. [Facebook] What happens when you scream out of your window in Sweden at night
    By Sephiroth in forum Facebook Famous
    Replies: 5
    Last Post: 12-21-2013, 05:40 PM
  3. PlayStation 4 launch window line-up
    By Name in forum PS4 News, Updates, and Rumors
    Replies: 2
    Last Post: 08-20-2013, 09:57 PM
  4. Cat Window Fail
    By Serious_M in forum Youtube Famous
    Replies: 5
    Last Post: 07-14-2013, 05:48 AM
  5. Squirrel Flies Out Window
    By Serious_M in forum Youtube Famous
    Replies: 2
    Last Post: 10-06-2012, 03:40 PM

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!

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
  •  

About 360haven

    360haven is an Forum Devoted To Game modding Fans from all over the world.

    An Awesome Community of Xbox 360 Gamers, Modders and Developers who Create & Share Tutorials, Applications, Gfx, Trainers and Gamesaves.

    A haven for the l33t.
    A scarce paradise for modders.

★★★★★¯\_(ツ)_/¯