jerone / UserScripts

🐵 My UserScripts
https://github.com/jerone/UserScripts#readme
GNU General Public License v3.0
342 stars 39 forks source link

The script "Hide replies on Twitter user account" doesn't seem to work anymore #2

Closed darkred closed 10 years ago

darkred commented 10 years ago

Hi

The script Hide_replies_on_Twitter_user_account unfortunately doesn't seem to work. (using FF28 w/ GM 1.15) The menu item to toggle hide/show replies by the script doesn't appear at all. (this must be caused due to the recent twitter layout update)

jerone commented 10 years ago

Originally the script was indeed build on the old Twitter layout. I'll have a look at it.

darkred commented 10 years ago

Thank you.

jerone commented 10 years ago

This is a known problem (see last paragraph) which I haven't found any solution for (yet).

The issue is that Twitter doesn't really let's you navigate their site. Instead they grab (almost) every link, fetch the content from that page and render it in a container. The way this works is similar to pjax, but probably with native history.pushState.

Again i looked through thousands of lines in Twitter source code, but couldn't find a way to hack into this.

The work-around at the moment is to reload/refresh the page if you want to use this script.

I'll close this issue as known with work-around. When I find a real solution I'll update this issue.

Thanks for reporting and using!

jerone commented 10 years ago

Dev note

More info about Twitter: https://blog.twitter.com/2012/implementing-pushstate-for-twittercom This logic is called Hijax

darkred commented 10 years ago

Thanks for reporting and using!

You're welcome!

About the workaround you suggested: unfortunately, no matter how many times I reload/refresh the page, the entry "show/hide replies" never appears in the "More user actions" button menu.

Also, btw, about your other script Hide_retweets_on_Twitter_user_account also the entry "show/hide retweets" never appears. Note: the entry "Turn off Retweets" that appears is a Twitter feature, that hides the retweets of an x user, from your timeline only - not from the current viewed user page too.

jerone commented 10 years ago

Hmmm, oke that's weird, because with the workaround it is working on my end (using FF28 w/ GM 1.15).

To be sure, if you open a new tab to https://twitter.com/UberFacts and click the wrench icon, you won't see "Hide Retweets" and "Hide Replies", right? test

darkred commented 10 years ago

Of course: the issue occurs in a new tab, too.

I even tried it in a clean FF profile, with only GM and the two scripts, logged in to twitter, followed the user for which you gave and the entries never appear: Screenshot

As I said in my OP, I also use FF28 w/ GM 1.15 and for what it's worth, I run Windows (v8.1 x64).

jerone commented 10 years ago

Thnx for testing.

I'm running exactly the setup and tested it working with FF29 on W7 without a problem. So weird.

Are there any errors in the console?

I made new versions for both scripts which may solve the problem: https://gist.github.com/jerone/9761592 Can you try them...

darkred commented 10 years ago

Unfortunately, the new versions didn't solve the issue.

With the previous ones, I didn't get any entry in the Browser console, JS category. With the new versions ones, filtering the Browser console for "user.js" I do get this entry, one time for each script:

unsafeWindow.$ is not a function  ---------> line 107 (of both scripts)
jerone commented 10 years ago

Twitter downloads the jQuery library after page load. To access it, I thought the timeout would be sufficient. Apparently at my end this file is initialized faster. Could you try to raise the timeout interval to 2000 ms for example before I look for another solution...

darkred commented 10 years ago

I tried changing the value to 2000 and it still doesn't work. (I don't get the entry in the Browser console anymore, though)

jerone commented 10 years ago

I just took a look at your screenshot again, and saw that my Twitter looks different then yours. Are you running a beta or something?

darkred commented 10 years ago

No, of course not.. It's FF28 stable, changeset https://hg.mozilla.org/releases/mozilla-release/rev/5f7c149b07ba That screenshot is taken in a clean profile, using in windows resolution 1440x900.

jerone commented 10 years ago

I meant a beta for Twitter. This is how my Twitter looks like: untitled

jerone commented 10 years ago

And the answer is Yes, but probably not intentionally: http://mashable.com/2014/02/11/twitter-redesign-facebook-google/

Until I get this new layout theres nothing I can do.

darkred commented 10 years ago

That twitter page in IE11 appears as in the FF screenshot

I haven't chosen any twitter beta opt-in

darkred commented 10 years ago

(We've posted simultaneously, previously).

Until I get this new layout theres nothing I can do.

it's just strange you still haven't got the new layout (that mashable link is dated 1.5 month ago)

jerone commented 10 years ago

(We've posted simultaneously, previously).

Yeah, I was 2 seconds "faster" :)

Until I get this new layout theres nothing I can do.

it's just strange you still haven't got the new layout (that mashable link is dated 1.5 month ago)

Apparently the beta isn't over (yet).

Do you have some JavaScript skills? If you could give me the selector for the menu I mite give it a try.

darkred commented 10 years ago

If I'm right it's this:

jerone commented 10 years ago

Thnx, I actually need to know the classes from the second divider from that menu. Are they dropdown-divider is-following?

darkred commented 10 years ago

Yes, exactly:

jerone commented 10 years ago

Ok, that exists. Maybe they changed the tweets list ID; it should be stream-items-id: untitled

darkred commented 10 years ago

I think I can't find such an ID:

jerone commented 10 years ago

I've updated the gist: https://gist.github.com/jerone/9761592

Edit: just did another update.

darkred commented 10 years ago

Yep, the entries now show up, but, the replies or retweets are not hidden.

jerone commented 10 years ago

Oke, that's progress. Could you show me the source for both an users reply and retweet. Here's account that has both right now: https://twitter.com/rem

darkred commented 10 years ago

Ok. A reply: A retweet:

jerone commented 10 years ago

New version: https://gist.github.com/jerone/9761592

darkred commented 10 years ago

They both work ok now. Thanks !

jerone commented 10 years ago

Cool :+1: I'll upload the new version soon.

Did you leave the timeout as default or was it set to 2000 ms ?

darkred commented 10 years ago

I left it as default.

jerone commented 10 years ago

I just committed a new version of both scripts that includes the fix for this issue. You probably want to remove the old scripts before installing the new ones.

darkred commented 10 years ago

Yes, thanks.

jerone commented 10 years ago

Just for development reference; New style profile: https://twitter.com/SamsungMobile More info: https://blog.twitter.com/2014/coming-soon-a-whole-new-you-in-your-twitter-profile Will test script when I have time.