tony-o / t.co-bypass

104 stars 21 forks source link

Remove Dependency on jQuery #7

Closed timdorr closed 10 years ago

timdorr commented 10 years ago

jQuery's nice and all, but it's a bit of overkill for this script. So, I got rid of it and replaced things with native functions. I assure you, they're not as scary as they seem!

Also, DOMSubtreeModified is super noisy and will have a rather negative effect on this script's speed (especially when combined with a non-native query like a not-attribute selector). I switched it out to MutationObserver, which is way less hyperactive, but still gives you all of the benefits of DOMSubtreeModified.

timdorr commented 10 years ago

Oh, and I don't know how to build a Safari extension, so I don't have a commit for that. Sorry :weary:

tony-o commented 10 years ago

@timdorr i added you to the readme for the gittip, just an FYI.

timdorr commented 10 years ago

:+1:

tomsterritt commented 10 years ago

Safari hasn't reacted well, and I'm not familiar with MutationObserver :weary:

[Error] NotFoundError: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.
    observe (greasemonkey.user.js, line 30)
    global code (greasemonkey.user.js, line 30)

Any suggestions?

Got it