jpgohlke / twitch-chat-filter

58 stars 37 forks source link

Chat filter broken on Greasemonkey 2.0 #157

Closed fincs closed 10 years ago

fincs commented 10 years ago

Yesterday the chat filter stopped working for me (Firefox). Turns out that Greasemonkey had updated itself to 2.0.

EDIT: Downgraded to Greasemonkey 1.15, working again.

MrCheeze commented 10 years ago

I had the exact same issue. The problem apparently has something to do with jQuery not being loaded properly. The following seemed to solve the problem:

  1. Add the following line somewhere in the script's header. // @require http://code.jquery.com/jquery-2.1.1.min.js
  2. Remove this line farther down: var $ = myWindow.jQuery;

e: scratch that, this doesn't actually work either. wait until someone who knows what they're doing comes up with a proper update, I guess.

Zero3K commented 10 years ago

Please look at https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/versions/ to see how to fix it.

hugomg commented 10 years ago

If I understand the info in Zero3K's link correctly, its impossible for a greasemonkry script to call a function defined by the page scripts. More specifically, while it still seems to be possible to override App.Room.prototype.addMessage (using exportFunction), it looks like our overridden function will not be able to call the original App.Room.prototype.addMessage to add messages that pass through the filter.

I'm afraid this might be a deal breaker :(

hugomg commented 10 years ago

Hmm, from my searches, it seems like it might be possible to run code in the page via script-tags. If that works we should be able to get rid of all the unsafeWindow stuff by running our code in the page context, just like we do with the bookmarklet.