Disable pinch zoom in webkit (or electron)

UPDATE 2: Use webFrame.setZoomLevelLimits (v0.31.1+) in render process (Differences Between Main Process and Renderer Process). Because smart zoom on mac still work with document.addEventListener. Example require(‘electron’).webFrame.setZoomLevelLimits(1, 1) UPDATE: deltaY property for pinch zoom has float value, but normal scroll event return int value. Now solution has no problem with ctrl key. Demo 2. document.addEventListener(‘mousewheel’, function(e) … Read more

FontAwesome fails to load fonts locally and in electron app

I had a similar issue (perhaps this answer will help someone). I use Maven to build projects (Java + JS). Maven Filter Plugin corrupted binary font files. I had to add includes and excludes: <resources> <resource> <directory>${project.sources}</directory> <filtering>true</filtering> <excludes> <exclude>**/*.woff</exclude> <exclude>**/*.ttf</exclude> </excludes> </resource> <resource> <directory>${project.sources}</directory> <filtering>false</filtering> <includes> <include>**/*.woff</include> <include>**/*.ttf</include> </includes> </resource> </resources>

How do I move a frameless window in Electron without using -webkit-app-region

Since your windows are frameless you can use the property -webkit-app-region which is valid even though your IDE says it’s not. You just should forbid the text selection and drag on buttons inside of your title bar too out of UX concerns. .titlebar { -webkit-user-select: none; -webkit-app-region: drag; } .titlebar-button { -webkit-app-region: no-drag; } The … Read more

Cannot find module ‘fs/promises’ Electron JS

I experienced this issue a few days ago as well. I realized that trying to fix another issue, I deleted the node_modules folder and the package-lock.json file, then run the npm install command. This made the build to fail with ‘fs/promises’. There are 2 solutions to this issue: Download the latest stable Node version. This … Read more

How do you handle CORS in an electron app?

Just overide header before send request using webRequest.onBeforeSendHeaders const filter = { urls: [‘*://*.google.com/*’] }; const session = electron.remote.session session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => { details.requestHeaders[‘Origin’] = null; details.headers[‘Origin’] = null; callback({ requestHeaders: details.requestHeaders }) }); put these codes in renderer process

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)