javascript - How to make Electron WebView fill specified size? -


i've tried adding electron webview basic app , set minwidth , minheight on shown below. when loads though ends 784px x 150px

<webview id="webpage" src="https://www.duckduckgo.com/" autosize="on" minwidth="800px" minheight="1200px"></webview> 

this issue other people have reported too, here in atom discussion page under "webview autosize" title :

https://discuss.atom.io/t/webview-autosize/16915/6

it seems 'autosize' doesn't last word resulting window size; css parameters may interfere , change result.

there css workarounds proposed issue may help:

-set html , body width 100% :

html, body {    width: 100%;    height: 100%;    margin: 0;    padding: 0; } 

-set viewport relative units in webview css:

webview {   display: block;       /* iframes inline default */   border: none;         /* reset default border */   height: 80vh;        /* viewport-relative units */   width: 95vw; 

}


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -