I mean there will likely be a perceptible delay in the playing of ringtone or vibration.

Also, it occurrs to me that this will load `js/notification.js` every time a class-0 message is received. I would just add `js/notification.js` to the application's startup.js files.