2 ms·
It seems like a remarkably bad idea to modify the prototypes of the built-in classes inside a Safari Extension. It's bad enough to do that in a library, but at
by eridius 15y ago
It seems like a remarkably bad idea to modify the prototypes of the built-in classes inside a Safari Extension. It's bad enough to do that in a library, but at least the web page is making a deliberate choice to use that library. When you put it in an extension, you've now modified the prototypes of the built-in classes in a way that affects the page, but without the page ever being aware of this. What happens if your function is named the same as one the page tried to define, but behaves differently?
For the record, document.querySelectorAll() is built-in and can do selector matching, and the only other thing you use Zepto for (adding classes) is trivially done manually.
- aaronbrethorst 15y agoThanks for the tip. As I'm sure you could tell from the code, this was the result of about 15 minutes of work this morning (from generating the CSR to get my certificate to tossing it onto GitHub). If I ever go back and touch this repo again, I'll use querySelectAll().