H
H
HPositron2022-03-24 12:43:54
JavaScript
HPositron, 2022-03-24 12:43:54

How to remove page scroll when opening hCaptcha in Firefox?

When opening the hCaptcha challenge window in Firefox, the page spontaneously scrolls to the very top (0,0), and then scrolls back after completing the task. This does not happen with Chrome-based..

html {
    height: auto !important;
}
Did not help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
HPositron, 2022-03-24
@HPositron

I decided this: I bind a callback through an attribute data-open-callback (documentation) and scroll back with it. Twitching to the beginning of the page and back is not visible.

W
wonderingpeanut, 2022-03-24
@wonderingpeanut

Greetings.

body {
    overflow: hidden;
}

Keep in mind that the content will shift to the width of the scroll. In order to avoid displacement, there are ready-made solutions (for example, there is either a react-scroll-bar for React, it seems to be called that), there are also css-native solutions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question