• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics with the tag "javascript". Back to normal view
    1. Extended Scripts for Tildes Alpha

      So, after a rather clunky script to open comment's link in a new tab with the left click, I got inspired by the idea of @kalebo and wrote also a script to quickly jump to new comments in a topic....

      So, after a rather clunky script to open comment's link in a new tab with the left click, I got inspired by the idea of @kalebo and wrote also a script to quickly jump to new comments in a topic.

      I thought about writing a dedicated script but felt like it was going to become overly complicated for a user to import different script.

      These script are all meant to give the community some QoL while lightening the pressure on @deimos so he can work without too much stress from all the requests. As soon as the feature are implemented you should get rid of those script that in some parts felt like bad hacks to me that I was writing it.

      I know the button to scroll to new messages is in a quite bad position (top center of your browser page) but I couldn't bear to deal with tampermonkey issue and its GM_AddStyle meta not working properly so I had to use the basic CSS provided by spectre already loaded in tildes.net.

      If someone knows how to figure out that goddamn meta, let me know.

      ========= UPDATE ============

      Edit: So apparently tampermonkey has issues with styles that are not yet fixed and firefox has some issue in general with script that inject stuff in the page (understandably).

      For tampermonkey the solution is simple. Use violentmonkey instead. you can just copy the script and it will work.

      For Firefox it's a little more dirty unfortunately but I cannot find other solutions. You need to open the internal URL about:config. Then search security.csp.enable and double click to disable it. After this the script will work.
      Firefox has a very strict policy and the only real solution would be to write an extension and I don't think it's worth the effort in the current state of development.
      For full description of what that policy does, check the official doc from mozilla: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP#Threats

      12 votes
    2. Script to jump to unread comments in a post

      Okay, so I got tired of scrolling through some of the long comment chains looking for that flash of orange that indicates a new post so I slapped together this solution. It's not pretty nor...

      Okay, so I got tired of scrolling through some of the long comment chains looking for that flash of orange that indicates a new post so I slapped together this solution. It's not pretty nor frictionless to use, but it's less annoying for me than scrolling for days just to find the new comments.

      Basic usage is to open the javascript console or scratch pad (e.g., Shift+F4 in Firefox) in your browser, paste in the following line from the code block and run it. It scrolls to the first unread comment and marks it as read; on subsequent runs it will do the same thing for the next unread comment and so on. You will need to enable new comment tracking in your Tildes preferences as well if you haven't done so yet.

      {var comment = document.getElementsByClassName("is-comment-new")[0]; if (comment != null) {comment.scrollIntoView(); comment.className = "comment"}}
      

      I had hoped that I could make it into a bookmarklet but unfortunately CSP nixes that option. If anyone else knows of a better way to do this let me know.

      10 votes