Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Wikipedia:User scripts

Page semi-protected
From Wikipedia, the free encyclopedia
Wikipedia information page for user-created scripts
"WP:US" and "WP:WPUS" redirect here. For WikiProject United States, seeWikipedia:WikiProject United States. For Manual of Style guidance on the US abbreviation, seeWikipedia:Manual of Style § US and U.S. For a list of user scripts for use on Wikipedia, seeWikipedia:User scripts/List. For the list of unreliable sources, seeWikipedia:Deprecated sources.
"WP:JAVASCRIPT" redirects here. For the parent WikiProject, seeWikipedia:WikiProject JavaScript.

icon
Wikipedia information page
This is aninformation page.
It is neither anencyclopedia article nor one ofWikipedia's policies or guidelines; rather, its purpose is to explain certain aspects of Wikipedia's norms, customs, technicalities, or practices. It may reflect differing levels ofconsensus andvetting.
iconYou takefull responsibility for any actions taken using any user script. You must read and abide by all relevantWikipedia policies when using this tool; failure to do so may result in beingblocked from editing.

User scripts are programs written inJavaScript to facilitate the editing of Wikipedia. User scripts enable user accounts to do things they otherwise could not. Many user scripts are available, ready for you to install. Also, you can write a new user script, either by modifying an existing script or by starting from scratch.

Security

User scripts have unlimited access to your account by their very nature – unlikeOAuth/bot password based applications such asHuggle, where you can control access levels, the script runs in your browser. Anything you can do on Wikipedia, it can do. As such, and this is especially pertinent to users with advanced permissions, make sure that you trust the user who wrote the script, as you will be held responsible for any actions it takes on your behalf. If you are "importing" a script (instead of copying the code itself) be warned that the user you are importing from could alter their script at any time. Only import from users you trust.

List of user scripts

If you come across or write a user script, please add it toWikipedia:User scripts/List andCategory:Wikipedia scripts. To add new scripts to the main list, use the{{user script table row}} template. Include at least the code page path and a short description. For example:

{{user script table row|name=My script|code=User:Example/MyJSpage.js|doc=User:Example/MyJSdocumentationPage|desc=This script does something useful.}}
  • Name defaults to the code page's name, without its path or ".js".
  • If a documentation page exists matching your .js page name, it will be linked automatically, without the need for a doc parameter.

Search for user scripts

Don't see what you need? You canrequest a new user script or search for an existing script.

Search within the code of user scripts:


Search user scripts by their title:


Installation

Automatic installation

  1. Check the checkbox atPreferences →Gadgets →Advanced →TickInstall scripts without having to manually edit JavaScript files (documentation) and click Save.
  2. VisitWikipedia:User scripts/List.
  3. Click "Install" after each script name to install the script. Some scripts may require additional steps, so be sure to visit the documentation if any.

Manual installation

Method for scripts which are located on theEnglish Wikipedia.

  1. First, make sure you arelogged in. Only logged-in users can install user scripts.
  2. Click here to edityour common.js file.
  3. Add the following line:{{subst:Iusc|script_path}} – replace "script_path" with the full name of the .js page that opens when a script's "(source)" link is clicked. TheInstall user script (Iusc) template will add the necessaryimportScript() line along with a backlink.
    • For example, to install theSharebox script, add the following line:{{subst:Iusc|User:TheDJ/sharebox.js}}
  4. Save the page andbypass your cache to make sure the changes take effect.

Remote scripts

Method for scripts which are not located on theEnglish Wikipedia.

Many of these scripts may not work at other wikis, either because the wiki has a different setup or their home wiki's URL is hardcoded into the script. Most script authors probably don't think about how to make their script work at other wikis. If you install a script globally, then you should avoid also keeping a copy inyour local common.js file. Otherwise, the same script is loaded twice when using that wiki and may cause issues.

  1. First, make sure you arelogged in. Only logged-in users can install scripts.
  2. Edit your common.js file on the other wiki. Alternatively, you may use your skin.js to work only your currentskin.
  3. Add the following line, replacingSCRIPT_PATH with the full name of the .js page that opens when a script's "(source)" link is clicked:
    mw.loader.load( '//en.wikipedia.org/wiki/SCRIPT_PATH?action=raw&ctype=text/javascript' );
    For example, to install theNoEditSummary script, add the following line:
    mw.loader.load( '//en.wikipedia.org/wiki/User:GhostInTheMachine/NoEditSummary.js?action=raw&ctype=text/javascript' );
  4. Save the page andbypass your cache to make sure the changes take effect.

Troubleshooting scripts

Main pages:Help:Safe mode andmw:Help:Locating broken scripts

If you encounter issues with a script, first tryclearing your browser cache andpurging the server cache. If you have any ad blockers or similar extensions installed, such asNoScript, check that wikipedia.org, wikimedia.org, mediawiki.org, and wikidata.org are exempted from any filters.

If you continue to experience problems, or if site functionality is significantly broken for you (for example, you are unable to edit any pages), you can enablesafe mode to temporarily deactivate all on-wiki scripts and stylesheets.

To temporarily enable safe mode, add?safemode=1 to the end of the web address (URL) of the page. Example:https://en.wikipedia.org/wiki/Main_Page?safemode=1. If the URL already includes a?, add&safemode=1 instead. Example:https://en.wikipedia.org/w/index.php?title=Main_Page&safemode=1.

Safe mode can be enabled on all pages by default by going to youruser preferences, selecting theAppearance tab, then enabling theAlways enable safe mode option.

User scripts and site gadgets will not run on the user preferences page, so you can still make changes to your account, such as changing your password, even if you have a faulty script installed.

Writing user scripts

Main page:Wikipedia:User scripts/Guide

Instructions for writing your own user scripts are included inWikipedia:User scripts/Guide.

Additional script-writing resources are presented below.

Snippets

The following code snippets still exist under the now defunct WikiProject User scripts. Many are still in use by live scripts, and they may provide insights for current script developers.

Snippets

This list is transcluded fromWikipedia:User scripts/Snippets.

Userbox

To advertise your user script development skills on your user page, you can use these userboxes.

MarkupRenders as
{{user script developer}}
This user develops
user scripts;
{{user script developer2}}
This user developsuser scripts.
{{user scripts created}}
This user has created auser script;
{{user scripts created|99}}
This user has created 99user scripts;

See also

Scripts lists
New scripts
Script writing
Templates
Userboxes
See also
Automated and semi-automated editing tools
General
technical help
Special
page
-related
Wikitext
Links anddiffs
Media files: images,
videos and sounds
Other graphics
Templates and
Lua modules
Data structure
HTML andCSS
Customisation
and tools
Automated editing
Portal:
Retrieved from "https://en.wikipedia.org/w/index.php?title=Wikipedia:User_scripts&oldid=1331486811"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp