Disable scrollbars at content embedder level

982 views
Skip to first unread message

Luke Halliwell

unread,
Jul 12, 2016, 11:47:37 PM7/12/16
to Chromium-dev
Is there a setting to prevent Chromium from automatically creating scrollbars for a page?  (The motivation is for TV platforms where there is no user input mechanism, so no way to scroll).

Elliott Sprehn

unread,
Jul 13, 2016, 1:23:26 AM7/13/16
to hall...@chromium.org, Chromium-dev

Maybe try enabling overlay scrollbars? You might also chat with some Opera folks as they run Chromium on TVs with a bunch of patches on top that customize various things for that type of device.

On Jul 12, 2016 8:47 PM, "Luke Halliwell" <hall...@chromium.org> wrote:
Is there a setting to prevent Chromium from automatically creating scrollbars for a page?  (The motivation is for TV platforms where there is no user input mechanism, so no way to scroll).

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Eric Seckler

unread,
Jul 13, 2016, 3:21:26 AM7/13/16
to esp...@chromium.org, hall...@chromium.org, Chromium-dev
For Headless Chrome, we're also interested in taking screenshots without scrollbars showing. We didn't look into this further yet, though. Luke, feel free to keep us in the loop. Overlay scrollbars are hidden initially but show when scrolling, which might be exactly what you need (yet, it's not quite what we need for headless).

Steve Kobes

unread,
Jul 13, 2016, 11:00:44 AM7/13/16
to esec...@chromium.org, esp...@chromium.org, hall...@chromium.org, Chromium-dev
Blink has WebFrame::setCanHaveScrollbars, which is used when Javascript calls window.open with "scrollbars=no".

It looks like it's also hooked up to RenderViewHost::DisableScrollbarsForThreshold, which isn't called anywhere(?).  Perhaps you can use that, or adapt it to your needs.

Luke Halliwell

unread,
Jul 13, 2016, 8:57:35 PM7/13/16
to Chromium-dev, esec...@chromium.org, esp...@chromium.org, hall...@chromium.org
Thanks for all the pointers.  Overlay scrollbars are an improvement in that they're less noticeable, and trivial to enable.  But they do show up still sometimes.

setCanHaveScrollbars seems more effective (I just quickly hacked in a call to verify this), but would obviously need some plumbing to make it usable (and it's not immediately clear to me what the interaction might be with other features).

Eric, will let you know if we make any progress (and I'm following your bug also).

Thanks,

Luke

Eric Seckler

unread,
Aug 22, 2016, 4:03:49 AM8/22/16
to Luke Halliwell, Chromium-dev, esp...@chromium.org
Hi Luke,

We've added an experimental "--hide-scrollbars" flag, which should get rid of (native, i.e. non-customized) scrollbars. Maybe that's also useful for you :)

Cheers,
Eric

Peter Kasting

unread,
Aug 22, 2016, 5:38:17 AM8/22/16
to esec...@chromium.org, Luke Halliwell, Chromium-dev, Elliott Sprehn
On Mon, Aug 22, 2016 at 1:01 AM, Eric Seckler <esec...@chromium.org> wrote:
We've added an experimental "--hide-scrollbars" flag, which should get rid of (native, i.e. non-customized) scrollbars. Maybe that's also useful for you :)

As the unofficial Chromium flags owner:

Flags must be limited-time options with a deprecation and removal plan.  What is the motivation for adding this flag, and the plan for removing it?

It is not acceptable to add this flag permanently, so hopefully that was not your intent.

PK

Eric Seckler

unread,
Aug 22, 2016, 7:42:27 AM8/22/16
to Peter Kasting, Luke Halliwell, Chromium-dev, Elliott Sprehn
Eventually, it should become a more selective option controlled through an API e.g. at WebContents level, rather than flag. Filed another bug to track that:

Peter Kasting

unread,
Aug 22, 2016, 6:29:12 PM8/22/16
to Eric Seckler, Luke Halliwell, Chromium-dev, Elliott Sprehn
On Mon, Aug 22, 2016 at 4:41 AM, Eric Seckler <esec...@chromium.org> wrote:
Eventually, it should become a more selective option controlled through an API e.g. at WebContents level, rather than flag. Filed another bug to track that:

Cool, thanks for following up on this.

PK 
Reply all
Reply to author
Forward
0 new messages