Replace external binaries with js code