min
min copied to clipboard
Add ability to zoom in-page.
I've just installed Min today and I am pretty pleased with it so far. But the recent issue I found is that I cannot zoom by doing a pinching gesture on my trackpad (don't know about the mouse wheel support by I suspect it's the same). If this feature is not fitting enough in the browser's spirit, maybe you could include it just as an option in preferences since it is very vital for people who use it.
In terms of the code side of things, from my experience, you only need this line of code:
webContents.setVisualZoomLevelLimits(1, 3)
It needs to be applied in terms of the webContents
of the BrowserView
displaying the web pages. (which I suspect is the way Min displays pages, there shouldn't be any other way to do it properly)
I could submit a one-line fix to this, once I look through the Min's code soon. But I think the maintainers could do it much quicker and better.
There is an open issue regarding that since 2020 and still hasn't been done yet #917. It references the same line of code that you posted. Maybe there is a difficulty in implementing that
Zooming using mouse wheel works Ctrl + Mouse Wheel Up/Down
but Ctrl + +
does not work for me
Oh well, By the way, now reading that issue, that person who suggested using setVisualZoomLevelLimits also mentioned that it would get reset every time the page is re-rendered and that you need to put the setting again in did-navigate. That's, if I remember correctly, what I have done when creating my own browser with Electron (not knowing someone has already done better than me) and I faced no issues with it. So again I don't see a way it wouldn't be implemented already. Also, what do you think about creating a pull request (I hope I'm not switching the terms up, I'm not that experienced with git) myself with the needed fix. Would the devs of Min accept it? (Sorry, pressed the wrong button and accidentally closed the issue)
I see no problem in creating a PR. If you think you can improve the app then why not. Just follow the guidelines that they set for Contributing code
Sorry, I just read this discussion. I tried this out, and it seems to work fine if we call the function again after every navigation: #2063. Let me know if you see any problems with it; otherwise, I think it should be fine to merge.
(It's always fine to make a PR; I just went ahead and did it myself since I had already written the code)
ping What's up with implementing this?
This was completed several months ago, I just forgot to close the issue.