question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NW.js version 0.18.0 beta 1 starts with a greater `window.devicePixelRatio` than the previous versions

See original GitHub issue

This issue is observed on Windows 7 where the system’s control panel setting for font size and other elements is 125%, see the screenshot:

(screenshot)

NW.js version 0.18.0 beta 1, unlike the previous NW.js versions, seems to observe this (system-wide) setting and starts with window.devicePixelRatio equal to 1.25, see the screenshot:

(screenshot)

As a result,

  • text is larger (in all windows) than in the previous versions of NW.js,
  • images are also larger, raster images become blurry and not pixel-perfect any longer (such as icons in “Developer Tools” console on the above screenshot).

This issue may be seen either as a bug (because raster images lose their pixel-to-pixel perfection) or as an intended behaviour (because NW.js now adheres to an additional system-wide setting).

If it’s a bug, it should be fixed.

If it’s an improvement, there should be a known (documented in release notes) setting to opt out of it. (For example, users of Mozilla Firefox may set layout.css.devPixelsPerPx to 1 on their about:config; is there anything like that in Chromium settings controlled by the file package.json of a NW.js-based application?)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
Siizercommented, Feb 11, 2017

@Mithgol Hi there! Solution 1 did it. I simply added “chromium-args” : “–force-device-scale-factor” on package.json file right after the window option list and everything is as on previous NW.JS version. Thanks a lot for your help. Regards

0reactions
Mithgolcommented, Jun 8, 2017

For the record, the alternative hack of body { zoom: reset; } stopped working in NW.js v0.23.x and thus "chromium-args": "--force-device-scale-factor" is the only remaining solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NW.js v0.18.0 Released with Today's Chromium 54 Upgrade ...
As Node.js v7.0 will be released soon, we'll upgrade to it in 0.18.x later. There is a change with 'window.devicePixelRatio', see issue 5306...
Read more >
Changelog - Cypress Documentation
Fixed a regression introduced in the Electron browser in Cypress 10.8.0 where the CYPRESS_EVERY_NTH_FRAME environment variable was not being set appropriately ...
Read more >
Reducing app distribution size in NW.js - DEV Community ‍ ‍
The four approaches we'll cover: Older versions of NW.js; Reducing Node Modules; Optimizing your app; Removing files from NW.js. 1. Using older ...
Read more >
mapbox-gl | Yarn - Package Manager
Mapbox GL JS is a JavaScript library for interactive, customizable vector maps on the web. It takes map styles that conform to the...
Read more >
nwjs/nw.js - Gitter
Hi all. I have been co-developing a visual programming language that now relies on the nw.js framework for its front-end. One of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found