Wikipedia:Cite4Wiki

Cite4Wiki is a XUL add-on, and is free and open-source software. It is a contextual menu ("right-click") citation-generating tool for Wikipedia. The add-on is compatible with stable versions of Gecko-based browsers that support add-ons.

The user can right-click to get a bare-bones Cite web source citation for the page currently loaded in the browser, such as a news report or a journal article. The information will be wrapped in a inline footnote citation. The code is then put on the clipboard for pasting into a Wikipedia article being edited.

The default output is in this format (see below for US-style dates):

You can even use it on multiple pages! Each one will get its own little popup window with citation details and you can just leave them there until needed, and re-use them multiple times.

The add-on is clever enough to strip " " from domain names before using them for the work parameter.

There is also a second context menu entry for generating a " Month D[D], YYYY " American-style date, for use in articles written in American English, per WP:ENGVAR.

Rationale
Far too many (especially inexperienced) editors simply paste in a URL and call it a source citation, leaving it to other editors to properly format the citation for even very basic information such as title, or to even determine whether the link pertains to the article at all rather than being a test edit, or spam or even an attack site (a serious potential problem for biographies of living people). This add-on alleviates some of the geeky pressure on inexperienced or technically disinclined editors, who need not remember complicated citation code to insert a basic citation with this add-on. It also makes cleanup of bare-URL citations easier on other editors, who can load the URL in question and copy-paste a proper, if minimal, citation over it in a matter of a seconds.

Download, installation and compatibility
The add-on is available from the Pale Moon Add-ons Repository at https://addons.palemoon.org/addon/cite4wiki/.

Click the install button, allow the add-on to install, and restart the browser to activate it. Its operation can be tested on any and all actual Web pages (browser-internal pages such as "Restore Session" cannot do anything with the add-on).

The add-on is known to work in Firefox 2.0 to 52 ESR, Pale Moon 2.0 to 29, Basilisk, SeaMonkey 2.1 to 2.53.7, and Borealis Navigator 0.9. It won't work in Firefox Quantum and Chromium-based browsers, and there's no plan to support those browsers, as it involves a rewrite of the whole codebase.

Usage

 * Edit an article.
 * In another browser tab, open a webpage you need to cite in the article.
 * Right-click on that page.
 * Select the Cite4Wiki context menu item (it has a helpful Wikipedia "W" logo next to it).
 * You'll get a dialog box showing the Cite web code; examine it, then press "Copy to cliboard", then close the dialog.
 * Paste the citation into the article, and edit it as needed.
 * Preview and save the article.

User input often needed
The add-on only grabs obvious information. Details that require human reading and judgment, such as author name, publication date, real-world publication company (publisher) and its location, etc., would need be entered manually when known, with specific parameters for such information. In some major news sites however, it will auto-fill some of this information.

Users of the add-on should review the details before saving a Cite4Wiki-generated citation into a real article. The add-on is entirely dependent upon what it is told by the site it is building a citation for. It is very common for site authors to forget to update the  of a page, if they have been copy-pasting code from one page to another. In other cases, this HTML field may simply repeat the work (site) name, with the page actually providing a real title only in a  heading that will need to be manually located, read and repeated in the template code generated by the add-on. Another common problem is the use of pipe ("|") characters as "breadcrumb" navigation separators in s; these will break the template, and must be escaped with |, e.g..

The site name reported in work may be more readable with cleanup (e.g. "FooBar.com" instead of "www.foobar.com"), or the site as a publication may prefer and advertise a different title (e.g. "AZBilliards.com - The A to Z of Billiards and Pool", not just "azbilliards.com", or even completely different, such as "BBC News" vs. "news.bbc.co.uk"). Some sites also munge the page title and site name (for example, this page at Wikipedia itself has a  of "Wikipedia:Cite4Wiki - Wikipedia, the free encyclopedia" in which only the first part would be the title information).

If the page is going to be cited more than once in the same article, be sure to name the reference:.

Use outside of en.wikipedia
The add-on will also work "out of the box" on other MediaWiki sites that have a copy of Wikipedia's Template:Cite web, as long as it is at that name, and uses the same basic parameters. Cite4Wiki's JavaScript source code can be easily modified, in the file cite4wiki.js to handle other set-ups, such as non-English Wikipedias with different template and parameter names.

History
The first add-on of this sort, WPCite, was designed in September 2008 by and coded by his associate Diego "Manuar" Cadogan, in Javascript, XUL and RDF, wrapped in Java and packaged in .jar files). It was released under the GNU Lesser General Public License, and provided basic citation information in a new browser window. In August 2009,  adapted it into a Java-free implementation, Cite for Wiki, using a pop-up window. It was also modified by . It was later modified by "Yojimbo Doodah" (details unknown).  In January 2010 it was updated by, whose subsequent versions fixed some bugs, added new features, and consistently used the name Cite4Wiki. More recent development was taken up by  and.

The tool still needs further development. Volunteers should contact the developers, register at GitHub, then check out the project at Mozilla Add-ons and GitHub.

1.4 was released in January 2011. The source code is at MediaWiki, with a GitHub repository.

A rewritten version in Mozilla Add-on SDK (formerly Jetpack), was supposed to be released earlier. It had an improved interface, new features, better data capture, and translations. The code can be found at the Cite4wikiNG repository at GitHub. There's currently no plans to revive that project, as Jetpack is effectively dead since Firefox Quantum, and UXP is moving away from it.

After nine years of being abandoned, this extension has been taken over by, and updated in order to remove dead code, provide a checkbox switch for vertical/horizontal layout in a new Preferences window, and make it compatible with UXP and SeaMonkey browsers.

Forthcoming
The new developer plans to make the extension more localization-friendly, and keep it compliant with how Wikipedia does inline citations.

Known issues
To-do list of stuff to fix:
 * 1) The add-ons validation process at Add-ons for Firefox 's "Developer Hub" throws a yellow warning (i.e., not a red error message) about a potential JavaScript issue, namely use of  ; code should be replaced if possible. No longer applicable pandakekok9 (talk) 07:44, 11 April 2021 (UTC)
 * 2) Needs more localization, so it will be more easily portable to other Wikipedias., and so it will stop giving another warning when uploaded to addons.mozilla.org.
 * 3) Inexplicable vestigial code ripped from AdBlockPlus needs to be removed from global.properties; some of this has been changed to refer to Cite4Wiki, but the presence of any of it at all is questionable. Resolved by removing global.properties instead pandakekok9 (talk) 07:44, 11 April 2021 (UTC)
 * 4) No installer script does pre-install cleanup of previous versions' files (such a script was included with the original WPCite, but was abandoned in Cite for Wiki for unknown reasons). This doesn't seem to be strictly necessary, but it can't hurt and could become necessary in later versions.
 * 5) Should auto-detect the (declared-in-HTTP-headers) language and add that as a parameter, if not English.
 * 6) Should auto-detect the (declared) file format as a MIME type and add that as a parameter, if not HTML.
 * 7) An option to format output with no linebreaks.
 * 8) Should, if possible, grab the company name, for the publisher parameter, from authentication data, the same way that Firefox itself provides this information just to the left of the URL entry field when at an  address and the site has a valid security cert.
 * 9) Should auto-detect the character "|" (pipe) and escape it as   to keep from breaking the Cite web template.  Already in beta testing for ver. 1.4.
 * 10) Completely fails in SeaMonkey 2.0.2 (at least under Windows Vista x64 SP2), and has not been tested with any other version. Add-on installs, but no right-click context menu items are available, ergo no popup window of wiki code.  Not tested in any other version, on any other platform. Not sure about SeaMonkey 2.0 (there doesn't seem to be an amd64 Linux build for it which I can test on), but should be working now starting 2.1. Turns out they forgot to overlay the chrome://navigator/content/navigator.xul on chrome.manifest. pandakekok9 (talk) 07:44, 11 April 2021 (UTC)