tuff_ghost (
tuff_ghost) wrote in
ao3some2013-04-04 02:51 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
FYI for userscript authors
If your userscript @requires jQuery, and your users are on Firefox, it's going to break JS running on Ao3 since the latest deploy, particularly the JS which shows modal boxes and hides the Share code on works.
If you're like me you were @requiring jQuery because you wanted your script to run in Chrome on Tampermonkey (where your script is sandboxed away from the host jQuery instance), and you didn't want to maintain two different copies of your script for Greasemonkey and Tampermonkey.
So, @require jQuery breaks stuff in Firefox, but you still need jQuery in Chrome. The solution is to get your jQuery instance from
If you're like me you were @requiring jQuery because you wanted your script to run in Chrome on Tampermonkey (where your script is sandboxed away from the host jQuery instance), and you didn't want to maintain two different copies of your script for Greasemonkey and Tampermonkey.
So, @require jQuery breaks stuff in Firefox, but you still need jQuery in Chrome. The solution is to get your jQuery instance from
unsafeWindow.jQuery
- this will point to the host instance of jQuery.
(function($) {
// your code which uses jQuery normally as $
})(unsafeWindow.jQuery);
no subject
no subject
no subject
no subject
no subject
If you mean can someone who doesn't know anything about JS edit scripts to make this change, yes you still can but you will either need to learn a tiny bit about JS, or exercise your human birthright pattern matching ability well enough to do the job :D
no subject
no subject
no subject
Does this make more sense?
no subject
no subject
(Anonymous) 2013-04-05 06:42 pm (UTC)(link)also, computers are not psychic
no subject
Thank you for you help :)
no subject
no subject
no subject
On a somewhat unrelated note... A while back I made my own clone of TumblrSavior for the archive (literally a clone - I used all his code too, with permission). Now I want to tweak it to be a little more intelligent and use jQuery, but I see you've already made a more intelligent version! I wanted to add the ability to filter by Work ID, and for my own education I'd like to try adding a configuration interface (using GM_setValue etc, or possibly http://userscripts.org/guides/11).
Anyway tl;dr, I don't think userscripts.org supports forking, so do you mind if I use your code as a basis for this? It seems like your approach is pretty much the same as the one I was pondering. XD
no subject
You might find browser storage useful for what you're trying to do; I never looked at GM_setValue but I found localstorage pretty easy to work with.
no subject
Thanks, I'll also look into localStorage - I had considered it but my non-comprehensive Googling indicated that it might be a little flakey with userscripts.