postEdit: Only call mw.cookie.get() if needed
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 8 Mar 2017 04:57:16 +0000 (20:57 -0800)
committerKrinkle <krinklemail@gmail.com>
Tue, 14 Mar 2017 19:19:27 +0000 (19:19 +0000)
commit475e0f2243eedb460520f70f0bec21dd1fa388bf
tree456f0a73f2987dc9d2c7ec9b38d4a61632fbec7b
parent130641ff14a497059d9691a80a8204d118327350
postEdit: Only call mw.cookie.get() if needed

Avoid synchronous document.cookie reads unconditionally during page load.
At least avoid the read where it isn't needed, such as non-view actions
and special pages.

Ideally this would happen in mw.requestIdleCallback, but unfurtunately
various extensions have a fragile dependency on reading mw.config
wgPostEdit at initialitation time which would likely fail if this is no
longer set synchronously. To be revisited...

Change-Id: Ib655bf6507333c1a9845a05eb436dca522efbab7
resources/src/mediawiki.action/mediawiki.action.view.postEdit.js