It would be a big security hole, so it’s not possible.
Well, it’s possible, but you should create a special applescript, acting as a “protocol helper” (search the forums for these keywords), then invoke it as “javascript:window.location.href=‘specialprotocol:whatever’;”.