During working on reviewing articles on Wikipedia I often get a problem that plugins don't get loaded. This is not a strict thing that has always-occur steps.
Rough steps
- Open review page (e.g. pl.wiki: https://pl.wikipedia.org/w/index.php?title=Specjalna:Zdezaktualizowane_przejrzane_strony).
- Open 10-20 review links.
- Press edit.
Result - plugin is not loaded.
Test code
Below is a test code you can use. You will notice addPlugin is not shown in console when the problem occures.
mw.loader.using('ext.visualEditor.desktopArticleTarget.init', function () { console.log('init'); // happens when VE is already loaded too // Register plugins to VE. will be loaded once the user opens VE mw.libs.ve.addPlugin(function () { console.log('addPlugin'); // only happens on-switch to VE (not when VE is already loaded) //return $.getScript('//pl.wikipedia.org/w/index.php?title=User:Nux/veCustomSearch.plugin.js&action=raw&ctype=text/javascript'); //return $.getScript('https://localhost:8443/_wiki_js/_przyciski%20edycji/veCustomSearch/veCustomSearch.plugin.js'); }); });
What I noticed is that addPlugin function doesn't work after the page is loaded. You will see init message in console when you run this after the editor is loaded, but not addPlugin message. So this is probably a problem.