Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main process minimization with Webpack #3209

Open
glani opened this issue Apr 22, 2023 · 0 comments
Open

Main process minimization with Webpack #3209

glani opened this issue Apr 22, 2023 · 0 comments

Comments

@glani
Copy link

glani commented Apr 22, 2023

Minimization of the application in webpack causes the problem with

const PRELOAD_PATH = require.resolve('@cliqz/adblocker-electron-preload');

as result in the minified code:

(node:87637) UnhandledPromiseRejectionWarning: TypeError: Error processing argument at index 0, conversion failure from
at Ci.enable (/Applications/SMBActApp.app/Contents/Resources/app/app-native/main.js:3994:85)
at Di.enableBlockingInSession (/Applications/SMBActApp.app/Contents/Resources/app/app-native/main.js:4066:93)
at c. (/Applications/SMBActApp.app/Contents/Resources/app/app-native/main.js:16148:63)
at Generator.next ()
at n (/Applications/SMBActApp.app/Contents/Resources/app/app-native/main.js:16058:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

original call is before minimization:

this._win = new BrowserWindow({

  },
});
if (this._blockMetadata.blockAds) {
  blocker.enableBlockingInSession(this._win.webContents.session);
}

the problem is on these two lines:

this.session.setPreloads(this.session.getPreloads().concat([PRELOAD_PATH]));

const PRELOAD_PATH = require.resolve('@cliqz/adblocker-electron-preload');

looks like workaround to put: loadCosmeticFilters = false in configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant