Tweaks-for-Reddit
Tweaks-for-Reddit copied to clipboard
Media (with sound) autoplays briefly when I refresh the home page, with "Automatically expand images" on
The new version has a weird issue. With "Automatically expand images" enabled, nearly every time I refresh reddit.com's home page, I hear a short snippet of sound and see the speaker icon in the address bar. And it's not always the same sound.
What I can confirm now is that the issue goes away if I disable this extension, as well as if I leave it enabled, and only disable that one "automatically expand images" feature. Then when I refresh the page, that quick sound doesn't play. Happy to help troubleshoot, just let me know what else to try.
Interesting! Do you have any other extensions enabled?
Are you able to pinpoint the source of the sound after the page loads? For example, are there any videos or gifs on the page that make the sound?
I do have some other extensions enabled, I will try experimenting by disabling them all, maybe do some process of elimination troubleshooting, and see if this is some sort of three-way conflict... I'll report back if I discover anything.
And no, I can't seem to pinpoint the source of the sound after the page loads. It's only image thumbnails I'm seeing, none of them are GIFs or videos that make the sound I just heard. I just know this behavior is new. It's not 100% reproducible either, but pretty regular over the past day or two and only happening on Reddit.
Thus far I'm unable to tie this bug to anything other than the Tweaks for Reddit extension and this particular "Automatically expand images" feature.
In the meantime, I noticed that this audio was autoplaying (briefly) even though this page-specific setting was on "Stop media with sound," which is really odd.
I changed it to "Never auto-play" and haven't experienced this issue since. I'll keep troubleshooting, but figured I'd share this in the meantime.
That's very odd. Are you using Safari or Safari Tech Preview?
The "automatically expand images" feature works like this:
-
Scan page and scrape all posts https://github.com/bermudalocket/Tweaks-for-Reddit/blob/b868bcbe905be77c8b79ab8d37b999f3873219e6/redditweaks%20Extension/Resources/redditweaks-script.js#L221
-
Filter out posts that don't have attachments. To work around a Reddit issue where literally every type of attachment (link, video, photo, etc) is classified as a video, another filter is applied which searches each posts's attachment link for domains likely to host an image, seen here: https://github.com/bermudalocket/Tweaks-for-Reddit/blob/b868bcbe905be77c8b79ab8d37b999f3873219e6/redditweaks%20Extension/Resources/redditweaks-script.js#L220
-
At this point we should have an array of posts that contain an image attachment. The last step is to loop through all of these posts and call the simple javascript
.click
function on each posts's "expando button", completing the "auto expansion". https://github.com/bermudalocket/Tweaks-for-Reddit/blob/b868bcbe905be77c8b79ab8d37b999f3873219e6/redditweaks%20Extension/Resources/redditweaks-script.js#L233
So my first thought was that a video or a GIF with sound was being clicked, which theoretically could cause a brief second of sound before Safari realizes and pauses it. But if that were the case, you'd be able to see a video or GIF post somewhere on the page, containing sound that matches what you hear at page load.
I did just realize that the entire time I've been trying to reproduce this, I've had an extension called "Stop the Madness" enabled which, among other things, stops video playback. I've disabled it for now and will try to reproduce the issue.
Hey @Fofer, are you still having this issue? Unfortunately I haven't come across it in the last two weeks.
Hi @bermudalocket, yes, I'm still experiencing the issue, so I'd just left the "automatically expand images" feature disabled to avoid it. Later this week I'll have time to experiment again with ALL OTHER extensions disabled, and then perhaps re-enable one at a time to check each one and see if I can pinpoint any additional culprits.
It's just very time consuming with a big handful of extensions and annoying because the issue isn't 100% reproducible, it only pops up from time to time. Noticeable and unnerving, but not consistent.
Of note, I am still running Big Sur 11.2.3 on this Mac (for unrelated but important reasons) so it's also possible this issue would go away if and when I update to the latest macOS. I'm running Safari 14.0.3 with it.