Look for pega doc for exact syntax of ~~pega.u.d.onload()..
2. Not suggetable: But works from sure. In the operator record, you will have Data-Portal.ShowDesktop activity, you can create your own activity and write the logic you want to achive and call OOTB activity in the last step. This requires updates to each and every operator record.
NewDefaults will be executed only if NewHarness is rendering. In this case, New harness will not be loaded.