Skip to content

Main process minimization with Webpack #3209

Open
@glani

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions