Topic on Extension talk:GlobalCssJs

Ability to exclude a wiki?

6
Billinghurst (talkcontribs)

@Legoktm: Is there an ability to exclude wikis? For instance, I wish to exclude English Wikisource from my global rollout, as I use other tools there and addition of global.js causes issues. I thought that the script configuration looked to sectionalise what was rolled where, however, I see that the output of onEveryWiki() is additive. Thanks.

Legoktm (talkcontribs)

You can wrap your global.js in:

if ( mw.config.get("wgDBname") !== "enwikisource" ) {
	// Whatever JavaScript you want to run on all wikis but enwikisource
}
XXN (talkcontribs)

hmm, for me this doesn't work...

Legoktm (talkcontribs)

Can you expand on how it's not working?

XXN (talkcontribs)

@Legoktm: Please take a look at my global.js; I tried to disable my personal popups.js on Wikidata and edittop.js on ruwiki and enwiki, but both these scripts continue to be loaded everytime on the specified wikis.

XXN (talkcontribs)

Ah, found, fixed, works. If for wikisource it's necessary to specify long DB name (i.e.: "enwikisource"), for wikipedias it's necessary to specify short DB name (for example "enwiki").

Reply to "Ability to exclude a wiki?"