Use window.wgDraft instead of var wgDraft (ResourceLoader change)