Skip to content

Commit c284d9c

Browse files
committed
ReFillLink: don't load on non-created pages
1 parent 06f390e commit c284d9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ReFillLink.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Thanks to [[User:Qcne]] for the idea. Please uninstall any old ReFill scripts to avoid double links!
2-
if ( mw.config.get( 'wgNamespaceNumber' ) >= 0 ) {
2+
const pageExists = mw.config.get('wgArticleId') > 0;
3+
const notSpecialOrFileNamespace = mw.config.get( 'wgNamespaceNumber' ) >= 0;
4+
if ( pageExists && notSpecialOrFileNamespace ) {
35
mw.util.addPortletLink(
46
'p-cactions',
57
'https://refill.toolforge.org/ng/result.php?page=' + encodeURIComponent( mw.config.get( 'wgPageName' ) ) + '&defaults=y&nowatch=y&wiki=en',

0 commit comments

Comments
 (0)