Zoom was completely disabled, please allow us to control the zoom
The zoom feature was completely disabled, see here: https://github.com/nwjs/nw.js/issues/7309
It seems there is no way to turn it on optionally. I have an app that is used by normal users, but also by visually impaired users and I want to allow them to zoom (if they want or need to) Please give us a nw.js manifest parameter, so I can decide if I want to allow the zoom feature or not. Doing it programmatically isn't as reliable as doing it directly via nw.js If there would be a parameter, I could provide two app versions: One app with a blocked zoom (=the current default) and one app where zoom is possible. Thank you.
Depending on the method of zoom that you want, you can implement your own "zoom" functionality by attaching an event listener to the body and adjusting your initial font size in your body or something.
document.body.addEventListener('keydown', (e) => {
if(e.ctrlKey && e.key == '+') {
// do zoom stuffs here using js
}
});
I know there are JS solutions, but a better and cleaner way would be a direct zoom support from nw.js And the zoom support is already there, it was just commented out here: https://github.com/nwjs/chromium.src/commit/f6f756d07acac3e146a58dfaf0c0d99d1d43655f So the team would just need to make the zoom support configurable.
Seems pretty clean, and uses the browsers full screen zoom capability. No font scale or css needed.
function setZoom(percent) {
nw.Window.get(window).zoomLevel = Math.log(percent/100.0) / Math.log(1.2);
}
https://docs.nwjs.io/en/latest/References/Window/#winzoomlevel
although there are many solutions out there, but reimplement a disabled existed function just making people mad, you also need to consider restoring when you restart the app or creating a new window.