CSS/Javascript Window Size
-
Hello,
I have a website that I am looking to open in Vivaldi with the exact same size window every time and also prevent the user from manually resizing the window. Is that possible using either CSS or javascript? I tried using a custom.css file and using the following modified code, but it isn't working. I am not using the native window. Help would be appreciated. Thank you.
#browser { display: fixed; flex-flow: column nowrap; position: relative; max-width: 449vw; max-height: 696vh; background: var(--colorBg); color: var(--colorFg); fill: var(--colorFg);
-
1vw or 1vh unit presents 1% of the maximum, so using 400 cannot make anything smaller.
Anyway, I doubt you can achieve this with css. You can make the whole browser smaller as specified, but in the background will still be a white canvas in the original size, and I don't know how to get rid of that with css. Disabling resizing is probably not possible with css either. -
Is it possible with javascript then? I know I can utilize a custom javascript file as well, but I haven't found the controls for window size yet...
Seth
-
Lol, I'm really bad with javascript, but try this...
window.resizeTo(500,350); window.onresize = function() { window.resizeTo(500,350); }
Resulting in a window of a specified size that cannot be resized. Pretty annoying tbh.
-
@luetage I will try this. Thank you.
-
@luetage It works well, thank you very much.
-
Ppafflick moved this topic from Modifications on