Jump to content

User:Eizen/AutoPurge

From Wikipedia, the free encyclopedia
AutoPurge
DescriptionAutomatically purges cache and reloads pages listed in window array
Author(s)Eizen
StatusBeta
UpdatedAugust 13, 2017; 7 years ago (2017-08-13)
BrowsersDeveloped in Google Chrome
SkinsAny
SourceUser:Eizen/AutoPurge.js
This is the documentation page for the AutoPurge.js user script.

AutoPurge is a JavaScript user script that automatically purges and reloads any pages within a user-defined window array. It performs in a similar manner to the standard Ctrl + F5 purge keyboard shortcut and the assorted null edit/purge button scripts and gadgets, but does so automatically upon navigating to a page listed in the array.

Installation

[edit]

The script may be used in a personal common.js file.

importScript("User:Eizen/AutoPurge.js");

It may be imported to a global.js file as well through the addition of the following import statement:

mw.loader.load("//wiki.riteme.site/w/index.php?title=User:Eizen/AutoPurge.js&action=raw&ctype=text/javascript");

Note that a window variable, notated as window.autoPurgePages = ["Page_1", "Page_2"]; must be included for the script to function. Pages in the array must be encoded and should match the value of the page's mw.config.get("wgPageName"); value.

window.autoPurgePages = ["Page_1", "Page_2"];
importScript("User:Eizen/AutoPurge.js");