Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Re-enabling pinch to zoom on Discord Canary
Find the directory for the `Local` instance of your Discord client, e.g. `AppData\Local\DiscordCanary\app-0.0.214`.
Make a directory called `app` in the `resources` directory, e.g. `AppData\Local\DiscordCanary\app-0.0.214\resources\app`.
Paste the `index.js`, `inject.js` and `package.json` files into the `app` directory you just made.
Restart your client.
Credits to Kura for helping me figure this out :)
const path = require('path');
const Module = require('module');
const { BrowserWindow, app } = require('electron');
const entry = Object.keys(require.cache).find(k => k.includes('browser-window.js'));
require.cache[entry].exports = class PatchedBrowserWindow extends BrowserWindow {
constructor (opts) {
opts.webPreferences = opts.webPreferences || {};
opts.webPreferences.preload = path.join(__dirname, 'inject.js');
return new BrowserWindow(opts);
const basePath = path.join(__dirname, '..', 'app.asar');
const { main } = require(path.join(basePath, 'package.json'));
app.getAppPath = () => basePath;
Module._load(path.join(basePath, main), null, true);
/* Where the magic happens: */
require('electron').webFrame.setVisualZoomLevelLimits(1, 3);
"main": "index.js"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment