Must admit that I've not seen this method before but I like look of it.

You can never tell what strange things people might have done (eg. creating an importScripts function or adding a docment object to the worker global).  I think your method looks more robust.

I will test it on a few browsers with the intention of changing the code if it works.