Is this work you're collaborating on together (as peers) or work you're supervising? Are you in any sort of relationship where you could be considered to be 'mentoring' the developer?
When collaborating, I like to provide my feedback in a way that allows the person to provide their own perspective.
"What do you think about moving this to a separate function so that we can keep each functions in the class small and focused on one specific purpose?"
When supervising you of course want to allow two-way-communication but you can be more direct, but make sure to use the correction as a teaching moment.
"Please move this block to a separate function so that we keep the functions in the class small and focused on their one specific purpose. See abc.js and xyz.js for good examples of classes that follow this pattern."
In chrome://extensions there is an option that lets you give chrome extension to content served from the file:// protocol - maybe that's what you need?
Amazing that 50% of people are nihilistic enough to just blow it up.