I've been a web dev my entire professional career. I've written a charting package in VML, SPAs before that was a thing, browser analytics code in vanilla javascript that "works" in IE5.5, SPAs transpiled from ES2017, and c++ for popular browsers.
Being a developer of a third-party script means not only that you battle browser discrepancies and bugs, but also non-conforming code that exists on the page. We have spent countless hours debugging issues, only to learn that the culprit was an overwritten method or property that behaves differently than its original native. I will share with you the tools and methods we use to identify and workaround these party crashers.