Inject JavaScript into HTML, synchronously