Flight of the (MeFi) Navigator June 24, 2015 9:44 PM   Subscribe

I'm having some issues with the super nifty MeFi Navigator userscript.

I've been using the MeFi Navigator userscript for a long time, but at some point developed some problems with it, and have been unable to contact the creator.

  1. The "Poster" label gets applied to the user who made the first comment in the thread, rather than the actual poster.
  2. The forward/backward buttons still work. However, the middle "hamburger" button to select a specific comment does not create an in-place drop down, but rather puts that box at the very top left corner of the page.


I'm using the apparent latest version of the script, Greasemonkey 3.2, and Firefox 39.0. I'm also using these other MF-related userscripts: HowlsOfOutrage, Mefiquote, Metafilter Scroll Tag, Mondo Image.

Help would be super welcomed!
posted by Chrysostom to MetaFilter-Related at 9:44 PM (65 comments total) 8 users marked this as a favorite

Some more info - I too am using this script, and have been tolerating the same issues. I also make use of most of the other scripts that Chrysostom mentions. Disabling all other greasemonkey scripts *except* MeFi Navigator does not solve the problems mentioned.
posted by namewithoutwords at 10:35 PM on June 24, 2015 [1 favorite]


Same here. Problems started after the site redesign.
posted by team lowkey at 12:35 AM on June 25, 2015


(Even when using the classic theme.)
posted by nobody at 4:30 AM on June 25, 2015 [1 favorite]


I'll just drop in here and mention that GraphFi hasn't worked at all since (I think) the last Chrome update, but it hasn't bothered me enough yet to actually send yourcelf a memail about it.
posted by phunniemee at 7:08 AM on June 25, 2015 [2 favorites]


Chiming in on the graphfi thing. (I miss it.)
posted by ocherdraco at 8:46 AM on June 25, 2015 [1 favorite]


Honestly, I'd be willing to pay someone with scripting knowledge ten bucks to fix Navigator.
posted by Chrysostom at 8:47 AM on June 25, 2015


Just wanted to come in and find out if there's a central place for scripts now that UserScripts is offline? I tweaked the old MeFi Scrolltag to fix the vertical alignment with the new theme, but didn't know where, if anywhere, people are putting scripts.
posted by Phredward at 10:06 AM on June 25, 2015


You could use GreasyFork.
posted by Chrysostom at 10:16 AM on June 25, 2015


Navigator started putting the first commenter as the poster when the site was redesigned. I too would love a fix.
posted by AugustWest at 10:36 AM on June 25, 2015


Did anyone email the creator like it says to in the projects post?
posted by jeffamaphone at 10:46 AM on June 25, 2015


Yeah, the poster of this thread did before posting this, but didn't hear back.
posted by LobsterMitten (staff) at 11:19 AM on June 25, 2015


A big group project to migrate all of thescripts over to GreasyFork from userscripts might not be a bad idea.
posted by Going To Maine at 5:03 PM on June 25, 2015


You can fix the "Poster" problem by amending line 59 of the script - change span[@class="smallcopy"] ... to ... span[@class="smallcopy" or @class="smallcopy postbyline"]

The line ends up looking like this, without the line breaks:
var elements = document.evaluate('//div[@class="comments" or @class="copy" or @class="comments bestleft"]/span[@class="smallcopy" or @class="smallcopy postbyline"]',document.body,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);

Works for me in Chrome 43 on the green and the blue on the Modern and Classic themes, I haven't checked the other subsites.

I haven't had a look at the hamburger menu placement thing.
posted by snap, crackle and pop at 5:33 PM on June 25, 2015 [11 favorites]


snap, crackle and pop: confirmed, your fix works in firefox with the classic theme. You have my gratitude.
posted by namewithoutwords at 6:15 PM on June 25, 2015


Thanks, snap, crackle and pop! You're awesome!!
posted by exogenous at 7:01 PM on June 25, 2015


I am so happy about this. Thank you snap, crackle and pop!
posted by rsclark at 7:51 PM on June 25, 2015


Thanks for the fix for the poster tag. I've been living with it rather than hack on it because I got so frustrated trying to fix the menu.

I tried a few things to fix the menu positioning a while back. snap, crackle, and pop! inspired me to tinker with it until it worked. Tonight, I finally fixed it, at least for Chrome and TamperMonkey, and am now kicking myself. I'm leaving out the line numbers, because mine are apparently different than what everybody else has. In the function mfn_list, I changed

var menu_left_pos = icon.offsetLeft - 1;
var menu_top_pos = icon.offsetTop - 1;

to

var rect = icon.getBoundingClientRect();

var scrollTop = document.documentElement.scrollTop?
document.documentElement.scrollTop:document.body.scrollTop;
var scrollLeft = document.documentElement.scrollLeft?
document.documentElement.scrollLeft:document.body.scrollLeft;

var menu_left_pos = rect.left + scrollLeft;
var menu_top_pos = rect.bottom + scrollTop;

You would not believe all the things I tried before I hit upon getBoundingClientRect() and getting the scrollTop and scrollLeft, including walking up the parentNode tree and adding all the offsetLeft's and offsetTop's together which didn't even work because you have to add the scroll offset or it won't position right.
posted by ob1quixote at 8:05 PM on June 25, 2015


ob1quixote: weirdly, the version of Mefi Navigator that I started with doesn't have any menu_left_pos or menu_top_pos variables? When I adapted yours to fit mine, it still doesn't work (just positions the menu right at the bottom of the document) - but there's probably other bits missing in mine compared to yours. (The script I'm using originated from here FWIW.)

I did come up with a solution that works for me, but there's an entirely new function so the line numbering gets a pretty wonky, so I put it up on pastebin if people want to try it out (full disclosure, the new function findPos() is lifted straight from Stack Overflow :P). I haven't tried it in Firefox at all. (Also this version also changes the formatting of the "Poster" and "Me" labels a bit, cause I didn't like them before.)
posted by snap, crackle and pop at 8:24 PM on June 25, 2015


Actually you know what, that version only works some of the time, and I'm totally just cargo culting this, so I'll bow out and let greater minds than mine figure it out. :)
posted by snap, crackle and pop at 8:32 PM on June 25, 2015


I may have added them myself. I've been trying to fix for a while now. There's a comment above that section from me from two years ago.
posted by ob1quixote at 8:33 PM on June 25, 2015


snap, crackle and pop - Thank you very much for the label fix!

ob1quixote - Appreciate your efforts as well! I don't have the menu_left_pos or menu_top_pos, either. Do you want to post your version so folks can try it out, or do you have any thoughts based on the original version?
posted by Chrysostom at 8:44 PM on June 25, 2015


(FWIW, I reinstalled today from userscripts, and clicking on the hamburger icon doesn't give me any kind of menu at all…)
posted by Going To Maine at 8:51 PM on June 25, 2015


(But then, the poster fix doesn't seem to be in other - poster just doesn't get mentioned, apparently - and I'm on Firefox.)
posted by Going To Maine at 8:52 PM on June 25, 2015

Chrysostom: “I don't have the menu_left_pos or menu_top_pos, either. Do you want to post your version so folks can try it out, or do you have any thoughts based on the original version?”
Seeing the original makes me believe those variables are vestiges of one of my previous attempts to fix it. If you're using the original version linked above, you want to replace lines 141 and 142

mfn_div.style.left = icon.offsetLeft-1;
mfn_div.style.top = icon.offsetTop-1;

with

var rect = icon.getBoundingClientRect();
var scrollTop = document.documentElement.scrollTop?
document.documentElement.scrollTop:document.body.scrollTop;
var scrollLeft = document.documentElement.scrollLeft?
document.documentElement.scrollLeft:document.body.scrollLeft;
mfn_div.style.left = rect.left + scrollLeft;
mfn_div.style.top = rect.bottom + scrollTop;

I'm reticent to put my versions on gist or pastebin or whatever because I've hacked on the originals so much I'm not even sure where all the changes are anymore.
posted by ob1quixote at 8:53 PM on June 25, 2015


Hmmm, still not working for me in Firefox.

Appreciate the willingness to poke at it though, ob1quixote, much obliged.
posted by Chrysostom at 9:04 PM on June 25, 2015


There's a conditional assignment there that may be throwing you off. Lemme use a pre tag instead to make it more obvious.
var rect = icon.getBoundingClientRect();

var scrollTop = document.documentElement.scrollTop?
                document.documentElement.scrollTop:document.body.scrollTop;
var scrollLeft = document.documentElement.scrollLeft? 
                 document.documentElement.scrollLeft:document.body.scrollLeft;

mfn_div.style.left = rect.left + scrollLeft;
mfn_div.style.top = rect.bottom + scrollTop;
posted by ob1quixote at 9:21 PM on June 25, 2015


Then again, I've only tried it on Chrome 43 for Windows, using TamperMonkey to run the scripts.
posted by ob1quixote at 9:22 PM on June 25, 2015


GraphFi works for me (looking at it now at work) on Chrome Version 43.0.2357.130 m running on Windows 7 Professional and (if I recall the Windows version correctly) it is working on the latest Chrome running on a Windows 8.1 machine at home.
posted by pracowity at 1:29 AM on June 26, 2015


Funk soul brother.
posted by pracowity at 2:41 AM on June 26, 2015


What do the mods think of creating scripts.metafilter.com as a repository for MeFi-centric userscripts and styles and whatnot? I sometimes feel like half the problems people have with them is that it is hard (especially with the demise of userscripts.org) to find the latest, most stable version of a given script.
posted by Rock Steady at 5:01 AM on June 26, 2015 [1 favorite]


If someone has Navigator working in Firefox with ob1quixote's changes, drop me a line? I've updated, but still getting same issue with drop down placement.
posted by Chrysostom at 6:29 AM on June 26, 2015


What do the mods think of creating scripts.metafilter.com...

My hesitation is that would make the scripts look like official add-ons. We can't support them and guarantee they work for everyone and hosting them here would imply that—even if we had heavy disclaimers everywhere. Plus there are some scripts that we absolutely do not endorse and we don't want to be in the business of deciding what gets hosted and what doesn't.
posted by pb (staff) at 7:38 AM on June 26, 2015


pb: "Plus there are some scripts that we absolutely do not endorse and we don't want to be in the business of deciding what gets hosted and what doesn't."

I think you could make it clear that it was just an unsupported repository, but this is a fair point.
posted by Rock Steady at 7:44 AM on June 26, 2015


Yeah, I share pb's note of caution about potential weirdness, but also do like the idea in general and think that's probably pretty manageable. Most people have no interest in being scriptological jerks and we can always say "no, thanks" to someone who is if it comes up.

We'll chew on the possibility. Would be nice certainly to not have this be such a vexing issue, so if something like a mefi Github group for collecting and maintaining scripts would work, that seems like a good possibility.
posted by cortex (staff) at 7:53 AM on June 26, 2015 [5 favorites]


Funk soul brother
posted by Going To Maine at 8:17 AM on June 26, 2015


Hm. I might consider building scripts.mefiwiki.com - I know a couple of things that might be good for that - but if we're working on scripts collaboratively, Github might be better.
posted by Pronoiac at 12:55 PM on June 26, 2015


I dream of a unified MetaFilter Enhancement Suite, like Reddit's but better.
posted by Going To Maine at 1:01 PM on June 26, 2015 [1 favorite]


Pronoiac: "Hm. I might consider building scripts.mefiwiki.com - I know a couple of things that might be good for that - but if we're working on scripts collaboratively, Github might be better."

Yeah, I would love to see everything up on github - someone could set up an Open Source org that we could all join?
posted by snap, crackle and pop at 2:36 PM on June 26, 2015


Plus there are some scripts that we absolutely do not endorse and we don't want to be in the business of deciding what gets hosted and what doesn't.

I don't think it would be too far out of Metafilter norms to have a rule against kill files, it's not like you'd be bringing back the image tag.
posted by ActingTheGoat at 4:34 PM on June 26, 2015


I'm really sorry that the fix that works for me in Chrome and Tampermonkey doesn't work in Firefox with Greasemonkey. Looking at Stack Overflow, there are differences in how the browsers handle coordinates. Working from that second link, I tried this, which still works for me in Chrome. I'm hopeful it will work in FF and IE and well. Replace lines 141 and 142 with:
    var rect = icon.getBoundingClientRect();
    var body = document.body
    var docElem = document.documentElement    
    
    var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
    var scrollLeft =  window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
    
    var clientTop = docElem.clientTop || body.clientTop || 0
    var clientLeft = docElem.clientLeft || body.clientLeft || 0
    
    var menu_top_pos = rect.bottom + scrollTop - clientTop;
    var menu_left_pos = rect.left + scrollLeft - clientLeft;
    
    mfn_div.style.left = Math.round(menu_left_pos) + 'px';
    mfn_div.style.top = Math.round(menu_top_pos) + 'px';
posted by ob1quixote at 4:36 PM on June 26, 2015


ActingTheGoat: "I don't think it would be too far out of Metafilter norms to have a rule against kill files, it's not like you'd be bringing back the image tag."

mdevore's diediedead killfile script is mostly broken these days anyway (at least in FF/classic site theme) - enabling it and loading metafilter.com just results in a blank page, regardless of who is listed therein.
posted by namewithoutwords at 4:42 PM on June 26, 2015


I don't think it would be too far out of Metafilter norms to have a rule against kill files

Said it once before, but I'll mention it again. You know who I have a personal email from that said killfiles were OK with him, from almost 10 years ago now? Their user number is a single digit before 2. I did notice that one of the anti-killfile crew have an uncited insertion about them in Wikipedia. I'd consider tagging it with a cite needed, but it'd be pretty close to WP:COI for me. I don't much care, and it's kinda funny someone would be sufficiently bothered to stick it in there.
posted by mdevore at 5:02 PM on June 26, 2015 [1 favorite]


mdevore's diediedead killfile script is mostly broken these days anyway

Thanks for heads up. I'll seeing about fixing it this weekend. If there's any other script you use out that is borked and abandoned by the author, and you need help with it, let me know. I'm in a fixing mood.
posted by mdevore at 5:04 PM on June 26, 2015


I thought I'd explore a couple of tools for building Greasemonkey script repositories, but without, say, modifying the mefiwiki.com server. I looked into deploying to Heroku. It didn't go well.
Greasyfork is a Ruby on Rails app; it relies on some things not available on Heroku, like sqlite3, and MySQL. It would need Sphinx for searching and Vanilla for discussion, and those dependencies wouldn't all fit on one Heroku dyno well.
OpenUser.js is a Node.js app; once I specified the JS buildpack, it at least ran, showing a few (stock?) scripts. When I attempted to register through accounts elsewhere, like Github or Google, it broke, as it helpfully told them it was running on localhost.
This isn't to say these are bad software, or badly put together; just that installation isn't as smooth as it could be, and they're not optimized for installation by me, on a very lazy day.
posted by Pronoiac at 10:02 PM on June 26, 2015


What would be wrong with just putting them up as a Github Gist and linking to the pages from there on the wiki?
posted by ob1quixote at 11:00 PM on June 26, 2015




ob1quixote: "What would be wrong with just putting them up as a Github Gist and linking to the pages from there on the wiki?"

I dunno, I'd prefer a real git repo to Gist (or pastebin, or 0bin, or...), for the forking and the pull requesting and such - so people can actually collaborate rather than sending around revised-but-isolated versions like they are now. We could still link to a git repo from the wiki.

(I've never really gotten involved with the whole mefi user scripts thing before partly because I'm hopeless at Javascript, but also because it seems like chaos, with nothing in source control and everyone hacking away separately in Tampermonkey or what have you... but then again I use source control for pretty much everything, work and play, so maybe it's just my not-so-inner pedant/control freak talking.)
posted by snap, crackle and pop at 4:16 AM on June 27, 2015


I don't disagree at all, except to note that Gists are git repositories so they're forkable, etc., but without the cognitive overhead of being a real github project.
posted by ob1quixote at 12:03 PM on June 27, 2015


Although on five minutes' further reflection, and the procurement of my second cup of coffee, I realize the advantages of a real github project are that more than one person can work on the script and we'd get a ticket system, etc., "for free."
posted by ob1quixote at 12:13 PM on June 27, 2015


Organizing gists on the wiki seems like the wrong tool for the job; it could work, but it seems like it would take a lot more effort than necessary.

I'm with snap, crackle, and pop about enjoying source control everywhere. I'm not sure Greasy Fork and OpenUserJS would scratch that itch, either. Github gets issues and collaboration, but the account creation *might* be a hurdle to clear, I dunno.

Hey, I have an idea. How about something akin to a bookmarking site, with collaborative tagging, pointing to scripts on Github?
posted by Pronoiac at 1:15 PM on June 27, 2015


I came up with a reason for discussions on the Greasemonkey plugins, realized this would miss version numbers and installation counts, and then realized that I'm in special snowflake territory and that it would be prudent to put this off until after my job-hunt.
posted by Pronoiac at 1:55 PM on June 27, 2015


ob1quixote, that latest attempt does work for me in Firefox. Thank you *very* much!
posted by Chrysostom at 8:25 PM on June 27, 2015 [1 favorite]


account creation *might* be a hurdle to clear, I dunno.

Folks might not feel comfortable associating their Github accounts with their MetaFilter accounts - it could well be a bridge too far. That said, struggling too much with this might be letting the perfect being the enemy of the good, especially given the relatively small number of users who make scripts.
posted by Going To Maine at 8:50 PM on June 27, 2015


Going To Maine: Folks might not feel comfortable associating their Github accounts with their MetaFilter accounts - it could well be a bridge too far. That said, struggling too much with this might be letting the perfect being the enemy of the good, especially given the relatively small number of users who make scripts.

Hmm, agreed; I was totally going to set up a separate Github account for this, and I figured anyone else who cared about maintaining separation also would, but maybe that's unreasonable.
posted by snap, crackle and pop at 12:09 AM on June 28, 2015


Folks who want to have a little script work out there but feel very public domain about it could also just let someone else put it out in the wild on their behalf. "Feel free to add this to the Github and folks can do what they like with it", that sort of thing.
posted by cortex (staff) at 5:48 AM on June 28, 2015


mdevore's diediedead killfile script is mostly broken these days anyway

No, I just tested it under both modern and classic using the latest Firefox, and the script successfully filtered out a single post based on either author or text within a post, so if you continue to have any problems with the latest version posted to Greasyfork (version 3.4), I'd appreciate an example where it is failing.
posted by mdevore at 3:53 PM on June 28, 2015


I have reached my technical limits having to edit the Navigator script as described above. Can someone either give me more specific instructions like navigating greasemonkey edit screens or post an edited working version of it somewhere? Please. (Or did I miss a link to it above?)
posted by AugustWest at 4:07 PM on June 28, 2015


Sorry, AugustWest. Here's a link to a Gist of the MeFi Navigator script I'm running on my machine. I can't even remember what all I've changed with it to keep it working over the last couple of years. I also don't really have a way to test it on any other configurations. Hopefully it will prove useful to some.
posted by ob1quixote at 5:04 PM on June 28, 2015


AugustWest: "I have reached my technical limits having to edit the Navigator script as described above. Can someone either give me more specific instructions like navigating greasemonkey edit screens or post an edited working version of it somewhere? Please. (Or did I miss a link to it above?)"

I've created a Github repo here, which contains the original script plus my "Poster" label fix, my "Poster" & "Me" label formatting tweaks and ob1quixote's hamburger menu positioning fix. This version works perfectly for me in Chrome to fix both problems that Chrysostom initially posted about.

I'm using Tampermonkey in Chrome - if I click the raw version of the script here, Tampermonkey automatically offers to re-install it. I'm not sure whether Greasemonkey works the same way.

If this version doesn't work for you, please speak up...
posted by snap, crackle and pop at 5:07 PM on June 28, 2015 [4 favorites]


I'm using Firefox, and that new one seems to work fine.
posted by Going To Maine at 5:12 PM on June 28, 2015 [1 favorite]


THANK YOU both ob1quixote and snap, crackle adn pop! I so appreciate it.

I clicked on the raw version of the script and just as s,c &p said, Tampermonkey came up, I hit reinstall, and viola. Even a non programmer like me can do that.

For future reference, I could have also copied the script from the Gist link into either a new file in Tampermonkey or deleted what was in the Navigator script and pasted that and it would have worked right?
posted by AugustWest at 7:30 PM on June 28, 2015 [1 favorite]


AugustWest: "For future reference, I could have also copied the script from the Gist link into either a new file in Tampermonkey or deleted what was in the Navigator script and pasted that and it would have worked right?"

Yeah either of those would work (although I'd say if you went with the first option of creating a new script, you'd probably also want to delete any other older versions that were previously installed). I'm glad it's working ok for you :)
posted by snap, crackle and pop at 8:05 PM on June 28, 2015


Very cool, thanks folks!
posted by exogenous at 6:12 AM on June 29, 2015


Adding my thanks!
posted by maxwelton at 2:25 PM on July 2, 2015



snap crackle pop, thank you for making the repo; ob1quixote and anyone for making the fixes!
posted by fizzix at 9:26 AM on July 6, 2015


« Older Camp NanoWrimo - the easier NanoWrimo   |   #loveWins #mefi Newer »

You are not logged in, either login or create an account to post comments