MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: stable
Implementation Tag
Description Adds a tag to create a link with a JavaScript event to go forward or back in the client's web browser.
Author(s) Techjartalk
Latest version 1.1 (2009-08-02)
MediaWiki 1.5+
PHP 5.2.3+
License Public domain
Download .zip .tar.gz
Translate the BrowserHistoryLink extension if it is available at translatewiki.net
Check usage and version matrix.

The BrowserHistoryLink extension adds a <historylink> tag to create a link with a JavaScript event that takes the client forward or back in the browser history.


You must have PHP 5.2.3 or above for this extension to work correctly!

  1. Create the directory "BrowserHistoryLink" in your extensions directory.
  2. Download and extract the files to this new directory.
  3. Add the following line to LocalSettings.php:
  4. To run this extension on MW 1.27+ see Known Bugs for a fix.
  5. Check Special:Version to make sure the extension was registered correctly.



To add the link, add a <historylink> with type parameter set to "forward" or "back" on a wiki page. Example:

<historylink type="back" />

This outputs the default link text "« Go Back".

Custom TextEdit

For custom link text, use this code (link text can be anything):

<historylink type="back">Go Back 1 Page</historylink>

This outputs the link text "Go Back 1 Page", or whatever is between the opening and closing tags.

The "go" ParameterEdit

Use this code to go back 3 pages, or whatever "go" is set to:

<historylink type="back" go="3" />

Note: The "go" parameter can not be less than 1!

CSS StylesEdit

The tag also has a "style" parameter that can contain CSS style information. Example:

<historylink type="back" style="font-weight:bold; font-size:13pt;" />

This will output a link that looks like « Go Back.

Going ForwardEdit

To go forward instead of back, use this code:

<historylink type="forward" />

It will output the link text "Go Forward »".
Note: All above parameters are also supported on "forward", including custom link text!
Note 2: Default link text may be different depending on your language.


New translations of the messages are welcome! If you make a new translation, please post the source code for the new translation on the talk page. Here's the list of current translations:

  • en - English (by Techjar)
  • es - Spanish (by Techjar)
  • fr - French (by Crainquebille)
  • de - German (by Scooty)
  • zh-hans - simplified Chinese (by pajoke)

Known BugsEdit

  • Extension is using deprecated wfLoadExtensionMessages() and wfMsg() (since MW 1.21) and need to be fixed to run on MW 1.27+. See Manual:Messages API#Help with replacing deprecated wfMsg* functions. To fix this problem edit the following lines in BrowserHistoryLink.class.php:
    • Replace wfMsg() with wfMessage()in Lines 26, 27, 39, 65, 85, 109, 129, 155, 175, 199 and 219.
    • Delete Line 15 wfLoadExtensionMessages()
  • Error messages about undefined classes "go" and "style" in MW 1.29. -> This Error messages shows up when there is no go back site avaible.


  • Does not parse wikitext.