instead of
var globalScript = new webkitGlobalScript(name, url, loadHandler, errorHandler);
to have this:
<webkit-globalscript name='...', src='url', onload=... onerror=...></webkit-globalscript>
The first tag with a specific name that provides a src or inline script or injected with innerText would effectively supply 'initial script'. The later-encountered tags withthe same name would have their initial script ignored and simply connected to the same one. The tag's DOM element would be EventTarget (for load and error) and have a 'context' property to pull the global scope object of the script.