<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bharatpedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Bharatpedia%3AUser_scripts</id>
	<title>Bharatpedia:User scripts - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.bharatpedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Bharatpedia%3AUser_scripts"/>
	<link rel="alternate" type="text/html" href="https://en.bharatpedia.org/w/index.php?title=Bharatpedia:User_scripts&amp;action=history"/>
	<updated>2026-09-23T04:49:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://en.bharatpedia.org/w/index.php?title=Bharatpedia:User_scripts&amp;diff=562997&amp;oldid=prev</id>
		<title>WikiDwarf: Add</title>
		<link rel="alternate" type="text/html" href="https://en.bharatpedia.org/w/index.php?title=Bharatpedia:User_scripts&amp;diff=562997&amp;oldid=prev"/>
		<updated>2026-09-21T09:04:05Z</updated>

		<summary type="html">&lt;p&gt;Add&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Bharatpedia information page for user-created JavaScript scripts}}&lt;br /&gt;
{{Information page}}&lt;br /&gt;
{{Tool warning|any user script}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;User scripts&amp;#039;&amp;#039;&amp;#039; are programs written in [[JavaScript]] that can be used to customize and enhance editing and other tasks on Bharatpedia. User scripts can add functions or tools that are not available by default, helping users perform repetitive or specialized tasks more efficiently.&lt;br /&gt;
&lt;br /&gt;
Many user scripts may be available for users to install. Users can also create their own scripts, either by modifying an existing script or by writing one from scratch.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
&lt;br /&gt;
User scripts run in the user&amp;#039;s web browser and can interact with the Bharatpedia interface using the permissions available to the logged-in user. This means that a user script may be capable of performing actions on Bharatpedia on the user&amp;#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
Unlike applications that use controlled authentication mechanisms such as [[mw:Help:OAuth|OAuth]] or [[mw:Manual:bot passwords|bot passwords]], a user script generally operates within the user&amp;#039;s browser session. Depending on what the script is designed to do, it may be able to read or modify information that the user could access or modify manually.&lt;br /&gt;
&lt;br /&gt;
Users should therefore install scripts only when they understand and trust their source. This is particularly important for users with advanced permissions or access to sensitive administrative functions.&lt;br /&gt;
&lt;br /&gt;
Users are responsible for actions performed through their account, including actions initiated by a user script. If a script is imported from another user&amp;#039;s script page, the source user may change the script at any time. Users should periodically review imported scripts and remove any that they no longer trust or need.&lt;br /&gt;
&lt;br /&gt;
== List of user scripts ==&lt;br /&gt;
&lt;br /&gt;
If you create or discover a useful Bharatpedia user script, consider adding it to the &amp;#039;&amp;#039;&amp;#039;Bharatpedia user scripts list&amp;#039;&amp;#039;&amp;#039; so that other users can find it.&lt;br /&gt;
&lt;br /&gt;
To add a script, provide at least:&lt;br /&gt;
&lt;br /&gt;
* the name of the script;&lt;br /&gt;
* the page containing its JavaScript code; and&lt;br /&gt;
* a short description of what the script does.&lt;br /&gt;
&lt;br /&gt;
If documentation is available, a link to the documentation page should also be provided.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:0.9em&amp;quot;&amp;gt;&lt;br /&gt;
{{User script table row&lt;br /&gt;
|name=My script&lt;br /&gt;
|code=User:Example/MyJSpage.js&lt;br /&gt;
|doc=User:Example/MyJSdocumentationPage&lt;br /&gt;
|desc=This script performs a useful editing task.&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The exact template parameters may vary depending on the user-script listing system used on Bharatpedia.&lt;br /&gt;
&lt;br /&gt;
=== Searching for user scripts ===&lt;br /&gt;
&lt;br /&gt;
If you cannot find a script that performs a particular task, you can search existing user scripts or request that a new script be developed.&lt;br /&gt;
&lt;br /&gt;
You can search within the source code of JavaScript user scripts using Bharatpedia&amp;#039;s search function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; margin: .5em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;inputbox&amp;gt;&lt;br /&gt;
type=fulltext&lt;br /&gt;
searchbuttonlabel=Search&lt;br /&gt;
prefix=User:&lt;br /&gt;
searchfilter=contentmodel:javascript&lt;br /&gt;
default=insource:&lt;br /&gt;
break=no&lt;br /&gt;
&amp;lt;/inputbox&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;br style=&amp;quot;clear:both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also search for user scripts by their page title:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; margin: .5em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;inputbox&amp;gt;&lt;br /&gt;
type=fulltext&lt;br /&gt;
searchbuttonlabel=Search&lt;br /&gt;
prefix=User:&lt;br /&gt;
searchfilter=contentmodel:javascript&lt;br /&gt;
default=intitle:&lt;br /&gt;
break=no&lt;br /&gt;
&amp;lt;/inputbox&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Automatic installation ===&lt;br /&gt;
&lt;br /&gt;
If Bharatpedia provides a user-script installation gadget, users can enable it through their [[Special:Preferences|preferences]] and then install supported scripts directly from the user-script list.&lt;br /&gt;
&lt;br /&gt;
# Open your [[Special:Preferences|user preferences]] and enable the user-script installation option, if available.&lt;br /&gt;
# Visit the Bharatpedia user scripts list.&lt;br /&gt;
# Select &amp;#039;&amp;#039;&amp;#039;Install&amp;#039;&amp;#039;&amp;#039; next to the script you want to use.&lt;br /&gt;
# Follow any additional instructions provided by the script&amp;#039;s documentation.&lt;br /&gt;
&lt;br /&gt;
Not all scripts can necessarily be installed automatically. Some scripts may require manual installation or additional configuration.&lt;br /&gt;
&lt;br /&gt;
=== Manual installation ===&lt;br /&gt;
&lt;br /&gt;
For scripts hosted on Bharatpedia, user scripts can generally be loaded through the user&amp;#039;s JavaScript configuration pages.&lt;br /&gt;
&lt;br /&gt;
# Make sure you are [[Special:UserLogin|logged in]]. User scripts are available only to logged-in users.&lt;br /&gt;
# Open your [[Special:MyPage/common.js|common.js]] page.&lt;br /&gt;
# Add the appropriate script-loading code.&lt;br /&gt;
# Save the page.&lt;br /&gt;
# [[Help:Purging|Purge your cache]] or bypass your browser cache if necessary.&lt;br /&gt;
&lt;br /&gt;
For example, a script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
User:Example/MyScript.js&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
may be loaded using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;&lt;br /&gt;
mw.loader.load( &amp;#039;/w/index.php?title=User:Example/MyScript.js&amp;amp;action=raw&amp;amp;ctype=text/javascript&amp;#039; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The exact loading method may depend on Bharatpedia&amp;#039;s configuration and the location of the script.&lt;br /&gt;
&lt;br /&gt;
Users should follow the installation instructions provided by the script&amp;#039;s documentation where available.&lt;br /&gt;
&lt;br /&gt;
=== Remote scripts ===&lt;br /&gt;
&lt;br /&gt;
A user may also load a script hosted on another MediaWiki installation. However, remote scripts should be used with caution.&lt;br /&gt;
&lt;br /&gt;
A script written for another wiki may depend on features, extensions, namespaces, URLs, configuration settings, or templates that do not exist on Bharatpedia. As a result, a script that works on another wiki may not work correctly on Bharatpedia.&lt;br /&gt;
&lt;br /&gt;
Remote scripts can also introduce security and maintenance risks. Users should install remote scripts only when they trust the source and understand what the script does.&lt;br /&gt;
&lt;br /&gt;
For example, a remote JavaScript file may be loaded using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;&lt;br /&gt;
mw.loader.load( &amp;#039;https://example.org/path/to/script.js&amp;#039; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The remote server must permit the script to be loaded by the browser, and the script must be compatible with Bharatpedia.&lt;br /&gt;
&lt;br /&gt;
If a remote script is also copied into a user&amp;#039;s local JavaScript configuration, the same script may be loaded more than once. This can cause errors or unexpected behaviour.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting user scripts ==&lt;br /&gt;
&lt;br /&gt;
If a user script causes problems, first determine whether the problem is caused by the script or by another part of the site.&lt;br /&gt;
&lt;br /&gt;
The following steps may help:&lt;br /&gt;
&lt;br /&gt;
# Purge the Bharatpedia page cache.&lt;br /&gt;
# Clear or bypass your browser cache.&lt;br /&gt;
# Temporarily disable recently installed user scripts.&lt;br /&gt;
# Check the script&amp;#039;s documentation for known problems or required dependencies.&lt;br /&gt;
# Check whether the problem occurs when the script is disabled.&lt;br /&gt;
# If the problem continues, report the issue to the script&amp;#039;s author or through the appropriate Bharatpedia support channel.&lt;br /&gt;
&lt;br /&gt;
If a script significantly interferes with the site, users may be able to temporarily disable user scripts by using Bharatpedia&amp;#039;s safe mode, if enabled by the site.&lt;br /&gt;
&lt;br /&gt;
For example, a safe-mode URL may use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
?safemode=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a page whose URL already contains query parameters, the safe-mode parameter can be added with &amp;lt;code&amp;gt;&amp;amp;safemode=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The exact availability and behaviour of safe mode depends on Bharatpedia&amp;#039;s MediaWiki configuration.&lt;br /&gt;
&lt;br /&gt;
User scripts generally do not run on certain system pages, including user preference pages, allowing users to access their account settings even when a faulty script is causing problems elsewhere.&lt;br /&gt;
&lt;br /&gt;
== Writing user scripts ==&lt;br /&gt;
&lt;br /&gt;
Users familiar with JavaScript can create their own user scripts.&lt;br /&gt;
&lt;br /&gt;
A user script can be as simple as a small modification to the editing interface or as complex as a tool that performs multiple editing or maintenance tasks.&lt;br /&gt;
&lt;br /&gt;
Before writing a script, users should become familiar with:&lt;br /&gt;
&lt;br /&gt;
* JavaScript;&lt;br /&gt;
* the MediaWiki JavaScript API;&lt;br /&gt;
* the [[mw:ResourceLoader|MediaWiki ResourceLoader]];&lt;br /&gt;
* Bharatpedia&amp;#039;s configuration and available extensions; and&lt;br /&gt;
* the permissions and limitations that apply to automated actions.&lt;br /&gt;
&lt;br /&gt;
Scripts should be designed carefully, particularly when they make edits automatically or perform actions repeatedly.&lt;br /&gt;
&lt;br /&gt;
=== Developing a user script ===&lt;br /&gt;
&lt;br /&gt;
A typical user script is stored as a JavaScript page in the user&amp;#039;s namespace, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
User:Example/MyScript.js&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script can then be loaded through the user&amp;#039;s [[Special:MyPage/common.js|common.js]] file or another appropriate JavaScript configuration page.&lt;br /&gt;
&lt;br /&gt;
A script should include documentation explaining its purpose, installation method, configuration options, dependencies, and known limitations.&lt;br /&gt;
&lt;br /&gt;
Scripts that make edits or other changes automatically should also provide appropriate safeguards to prevent accidental or unintended actions.&lt;br /&gt;
&lt;br /&gt;
=== Code snippets ===&lt;br /&gt;
&lt;br /&gt;
Common JavaScript and MediaWiki code snippets can be useful when developing user scripts. Developers should verify that older examples remain compatible with the current version of MediaWiki and Bharatpedia before using them.&lt;br /&gt;
&lt;br /&gt;
== User script developers ==&lt;br /&gt;
&lt;br /&gt;
Users who create user scripts may identify themselves as user-script developers on their user pages using an appropriate userbox, if Bharatpedia provides one.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{user script developer}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The availability of particular userboxes depends on Bharatpedia&amp;#039;s templates and configuration.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Help:JavaScript]] – information about JavaScript on Bharatpedia&lt;br /&gt;
* [[Help:Editing]] – general information about editing Bharatpedia&lt;br /&gt;
* [[Help:Automated editing]] – information about automated editing&lt;br /&gt;
* [[Special:MyPage/common.js|Your common.js]] – your personal JavaScript configuration&lt;br /&gt;
* [[Special:Preferences|User preferences]]&lt;br /&gt;
* [[mw:ResourceLoader|MediaWiki ResourceLoader]] – MediaWiki&amp;#039;s JavaScript loading system&lt;br /&gt;
&lt;br /&gt;
[[Category:Bharatpedia technical help]]&lt;br /&gt;
[[Category:Bharatpedia scripts]]&lt;br /&gt;
[[Category:JavaScript]]&lt;/div&gt;</summary>
		<author><name>WikiDwarf</name></author>
	</entry>
</feed>