jnschulze / flutter-webview-windows

A WebView2-powered Flutter WebView implementation for the Windows platform.
BSD 3-Clause "New" or "Revised" License
203 stars 120 forks source link

Need suggestion to Hide Scrollbar on Webview #270

Open fionicholas opened 9 months ago

fionicholas commented 9 months ago

Hi @jnschulze ,i have implement the webview windows, but i need to hide the scrollbar on Web view

Any suggestion from you guys, for hide the scrollbar ?

Screenshot 2023-12-11 092329
joeljoy commented 9 months ago

Were you able to find any method?

dhola-hardik commented 9 months ago

Try this

<!DOCTYPE html>
<html>

<head>
    <title>Camera Access Demo</title>
    <style>
        body {
            margin: 0;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        #camera {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
kuangye89757 commented 3 weeks ago

webViewController.addScriptToExecuteOnDocumentCreated( """ document.addEventListener('DOMContentLoaded', () => { document.querySelector('body').style.overflow='scroll'; var style=document.createElement('style'); style.type='text/css'; style.innerHTML='::-webkit-scrollbar{display:none}'; document.getElementsByTagName('body')[0].appendChild(style)}); """ );