change domComplete to loadEventEnd
add setTimeout to let WebKit release the context