Last modified: 2014-02-12 23:35:40 UTC
wgCategories is not populated on wgAction = edit
It is on view or submit, should be on edit as well.
As it actually disrupts the consistency of the information about given page for gadgets, so they can't work properly on editing page, I'm increasing the importance back to normal.
But on submit it contains only the categories from the section edited and not from the whole page.
That is the same problem as with the "templated used" section. On edit section this is also not added, because you have to parse the wikitext to get the templates. This is done on preview so the templates are shown.
In case it adds any motivation, [[Wikipedia:Twinkle]] would like to use this information to provide a talkback opt-out capability for user talk pages.
For now I will implement the opt-out using a lazy-loading API call when wgCategories is empty, but it would be nice to just be able to use wgCategories all the time and not have to query the API at all.