documents the argument to getBrowser as a string:
getBrowser(selector : String)
On the other hand, getBrowser also accepts a dom element object as an argument value:
getBrowser(dom)
It works because jquery $(selectorStringOrDom) accepts both selector strings and dom objects.
In case of multiple X3DCanvases, this is often convenient when unique selector strings are not immediately available. For example, cobweb_dom uses getBrowser in this way. The SAI spec. does not have a requirement one way or the other.
Intended or not, this behaviour could be explained on the web page since it is useful.
There is also the question which browser is returned in case the selector matches multiple X3DCanvas elements. The first one? This could be a separate issue.
http://create3000.de/cobweb/accessing-the-external-browser/
documents the argument to getBrowser as a string:
getBrowser(selector : String)
On the other hand, getBrowser also accepts a dom element object as an argument value:
getBrowser(dom)
It works because jquery $(selectorStringOrDom) accepts both selector strings and dom objects. In case of multiple X3DCanvases, this is often convenient when unique selector strings are not immediately available. For example, cobweb_dom uses getBrowser in this way. The SAI spec. does not have a requirement one way or the other.
Intended or not, this behaviour could be explained on the web page since it is useful.
There is also the question which browser is returned in case the selector matches multiple X3DCanvas elements. The first one? This could be a separate issue.