Wikipedia:User scripts/Guide: Difference between revisions
Content deleted Content added
Johnduhart (talk | contribs) →Finding elements: capitialization |
Johnduhart (talk | contribs) →Checking the page: New mw.config usage |
||
Line 187:
Many scripts are supposed to work only on some pages. You can check:
* The page address
<source lang="javascript">
if (
//continue only on history pages
</source>
* <tt>wg</tt> variables; many of them have the same meaning as [[Help:Magic words|Magic words]]
<source lang="javascript">
if ( mw.config.get( 'wgCanonicalNamespace' ) === 'User_talk') {
//continue only on User_talk pages
</source>
*
<source lang="javascript">
function func_start () {
if (
</source>
|