FYI requestIdleCallback flag gone in Safari

Tiny Tiny RSS needs window.requestIdleCallback but it’s not supported in Safari. You used to be able to enable it by turning on the “requestIdleCallback” flag under “Experimental Features” but as of version 16.4.1 (Mac and mobile Safari), that option is gone. It’s also gone from Safari Technology Preview.

To use Safari (or any browser on iOS/iPadOS), follow the advice given before:

  1. Create themes-local/local-overrides.js
  2. Put the contents of https://github.com/pladaria/requestidlecallback-polyfill/blob/master/index.js there.

https://gitlab.tt-rss.org/tt-rss/tt-rss/-/commit/31ef788e02339452fa6241277e17f85067c33ba0

might as well add this already

1 Like

Yep, that takes care of it.

Which container image includes the update to make Safari (and iOS devices as a whole) work again? This one does not change it for me: Docker

yes.

$ docker run --rm -it --pull=always cthulhoo/ttrss-fpm-pgsql-static:latest grep -r timeRemaining /src/tt-rss/
latest: Pulling from cthulhoo/ttrss-fpm-pgsql-static
Digest: sha256:9bbb2413f03a6c9dfe4522c03b6f3af1170884c6564d8ec6279901ab62f01c47
Status: Downloaded newer image for cthulhoo/ttrss-fpm-pgsql-static:latest
/src/tt-rss/js/common.js:                                       timeRemaining: () => Math.max(0, 50 - (Date.now() - start))

When I update using

docker-compose down && docker-compose rm
docker-compose up --build -d

I’m only getting through commit 0fcc2d1d (missing the Safari fix in common.js, commit 31ef788e)

My origin URL is https://git.tt-rss.org/fox/ttrss-docker-compose.git … Am I’m doing something wrong?

Thanks.

unless you’re a developer, you should use pre-baked docker images:

https://git.tt-rss.org/fox/ttrss-docker-compose.git/tree/README.md?h=static-dockerhub

basically just replace the compose file from static-dockerhub branch (above) in the same directory so it would pull images instead of trying to build your own.

alternatively, pull latest docker scripts and investigate why latest source is not pulled while building.

but seriously, just use docker hub images. there’s no need to use anything else now that they’re multiplatform.

Well crap, it sure looks like the fault is mine. I have been using using a docker-compose.override.yml in order to configure volumes so I can add my own themes and plugins as well as the local-overrides.js file for the Safari fix (plus some minor development in the past but it has been a long time.) I was using the dynamic build instructions from the Docker FAQ.

What is the recommended procedure for installing custom themes/scripts if using static-dockerhub? The Docker FAQ mentions modifying docker-compose.yml changing (I assume):

    volumes:
      - app:/var/www/html
      - ./config.d:/opt/tt-rss/config.d:ro

to

    volumes:
      - /opt/tt-rss:/var/www/html
      - ./config.d:/opt/tt-rss/config.d:ro

Sorry, but I really am still a Docker newbie, just trying to tread lightly so I don’t run into the same issues converting from dynamic to static as some other folks.

it should work the same, the only difference is that tt-rss source is not pulled from git. however, i would instead try to map themes.local & plugins.local instead of tt-rss/ so that main tt-rss source is guaranteed to update properly. it’s easy to screw up permissions on bind mounts. not sure if it’ll work or not.

something like this

# docker-compose.override.yml

version: '3'

services:
  app:
    volumes:
      - ./tt-rss/plugins.local:/var/www/html/tt-rss/plugins.local
      - ./tt-rss/themes.local:/var/www/html/tt-rss/themes.local

  updater:
    volumes:
      - ./tt-rss/plugins.local:/var/www/html/tt-rss/plugins.local
      - ./tt-rss/themes.local:/var/www/html/tt-rss/themes.local

  web-nginx:
    volumes:
      - ./tt-rss/plugins.local:/var/www/html/tt-rss/plugins.local
      - ./tt-rss/themes.local:/var/www/html/tt-rss/themes.local

if this works properly, i’ll update the faq entry on how to have custom plugins and stuff.

Thanks, will give it a shot (hopefully) tomorrow.

Sorry, when you say updater: is the same, do you mean the same as in the shipped docker-compose.yml or the same as in the dynamic image for development docker-compose.override.yml in the FAQ? Or the same volumes change as is in the app: (which seems most likely?)

same means just copy-paste the volumes: override from what’s under app:

e: updated the above post

Well let me say you’ve been a great help as always! But let me also say I’m an idiot because now I recall the other reason I use the dynamic development build in the first place (not just themes/plugins) … I always make a tiny tweak in js/Article.js that prevents the vertical snapping (it’s because of the way I go through feeds, start at the bottom and CTRL-UP) … it was my fault it wouldn’t update because my modification to Article.js was blocking the git pull part of the build.

There was no notice when doing the docker-compose up --build -d so I didn’t realize it until browsing into the static volume and running git commands from there. Sorry, completely and totally my fault and I’m good now after unstuffing my own mess.

My modification to Article.js is to comment line 429:

//ctr.scrollTop = row.offsetTop - grid_gap;

Thanks, Fox!

since git repo is updated on container startup (rather than when building) the error would be in the container log instead.

container doesn’t fail on startup in this case because:

  1. this would break your tt-rss install if git.tt-rss.org or your ISP is down
  2. it would make the container useless for development, which is what’s it for

in your particular case i think it would be easier to make a plugin which would patch this function in Article.js. :thinking:

Thanks Fox. I’ve looked (briefly) at how to do this and so far it was easier to just maintain a one-off but maybe I’ll get some time to devote to this. :slightly_smiling_face:

i don’t think i understand the idea behind the patch above though. wouldn’t this just make cdmMoveToId() do nothing thus breaking the hotkeys?

It has to do with where the article opens when “opening” a collapsed headline. Say you have a long list of collapsed headlines, when you “open” a collapsed headline in the middle of the viewing portal, my eye expects it to push the content down but not scroll to the top of the viewing portal. Commenting this line prevents that. Essentially tracking the headlines is easier without it jumping around if I open an article. Well, let me rephrase, only the lower headlines move when opening a collapsed article and everything returns to its previous position when closing an article. Hard to explain, but does that make sense?




Trying to explain it with pictures/screen shots.

ah! that makes more sense, thanks.

@tsimmons i think this is a legitimate enough use case, so

https://gitlab.tt-rss.org/tt-rss/plugins/ttrss-cdm-no-move-on-expand
https://gitlab.tt-rss.org/tt-rss/tt-rss/-/commit/0578bf802571781a0a7e3debbbec66437a7d28b4

e: it’s on the plugin installer but you’ll need latest tt-rss source for it to do anything.