icirellik / glowforge-material-manager

A simple chrome extension to allow saving custom materials.
MIT License
17 stars 7 forks source link

Need try/catch around window.store listener #110

Closed glowforge-opensource closed 5 years ago

glowforge-opensource commented 5 years ago

https://github.com/icirellik/glowforge-material-manager/blob/68118896a25a2208162ed634f2b362e88a2fe1ee/public/content.js#L229

Attaching this into Glowforge window.store as a listener and running code inline to that handler means any uncaught error here will trigger Glowforge logger and uncaught error policy which prevents users from using the site in an unknown state.

Adding a try catch around this code (ideally the entire listener block) will prevent issues from bubbling out of the plugin and into our application.

icirellik commented 5 years ago

Oops, should've thought about that.

Patched and released: https://github.com/icirellik/glowforge-material-manager/pull/111