Danbooru

Mobile gestures not working when viewing images

Posted under Bugs & Features

Mobile gestures work while viewing gallery, but when I click into an image to look at it, swiping right doesn't take me back anymore. Really annoying to reach down and hit back when you're used to swiping and tapping

As you can see I was the one asking the questions :)

I have been looking into finding a hack to bring it back and I discovered that the (android) browser Kiwi allows you to install chrome extension, which means you can install tampermonkey. So what I need now is a script that would bring back this feature.
Is it possible that I could use the part that was removed for this? @evazion

// ==UserScript==
// @name         Danbooru: Swipe Back
// @match        https://*.donmai.us/*
// ==/UserScript==

if ($("#c-posts #a-show").length) {
  let hammer = new Hammer(document.body, {touchAction: 'pan-y', recognizers: [[Hammer.Swipe, { threshold: 20, velocity: 0.4, direction: Hammer.DIRECTION_HORIZONTAL }]], inputClass: Hammer.TouchInput});
  hammer.on("swiperight", e => window.history.back());
}

This should work. This is just a basic demonstration; no warranty if it breaks.

evazion said:

// ==UserScript==
// @name         Danbooru: Swipe Back
// @match        https://*.donmai.us/*
// ==/UserScript==

if ($("#c-posts #a-show").length) {
  let hammer = new Hammer(document.body, {touchAction: 'pan-y', recognizers: [[Hammer.Swipe, { threshold: 20, velocity: 0.4, direction: Hammer.DIRECTION_HORIZONTAL }]], inputClass: Hammer.TouchInput});
  hammer.on("swiperight", e => window.history.back());
}

This should work. This is just a basic demonstration; no warranty if it breaks.

Thank you so much, it works really well :D

1