implement init.js handling in plugins