var mgmt = navigator.mozApps.mgmt;

function tryShowHomescreenSection() {
  ...
}
mgmt.oninstall = mgmt.onuninstall = tryShowHomescreenSection();


I don't think you need to expose methods on the Settings object.