addOnloadHook( function () {
  if(window.disableSandboxLink) return;
  var sbLink = (wgUserName) ? 'Special:Mypage/sandbox' : 'Wikipedia:Sandbox'
  addPortletLink('p-personal', wgArticlePath.replace(/\$1/, sbLink ), 'My sandbox', 'pt-sandbox', 'Your personal sandbox', null, document.getElementById('pt-preferences'));
});