max-mapper / max-mapper/elementary-electron

Enabling remote in BrowserWindow fixes the pdf export for me

Open
#37 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
231
Forks
43
PR merge metrics
No merged PRs in 30d

Description

Hi, i was having an issue where electron returns a require('electron').remote as an undefined,
i searched online, the solution to this is to add to the app.js file inside the webPreferences

enableRemoteModule: true

with this fix, i finally got index.js working, and i succesfully exported the pdf file

Complete code:

electron.app.on('ready', function () {
  var mainWindow = new electron.BrowserWindow({
    width: 600, height: 800, webPreferences: {
      nodeIntegration: true,
      enableRemoteModule: true
    }
  })

i included the nodeIntegration: true to fix other issues

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review app.js and index.js to understand how BrowserWindow webPreferences and PDF export are currently configured. Verify whether the reported remote-module settings match the project's Electron version and whether the export path can be reproduced; done would require a confirmed, documented fix in the repository rather than only a user workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, javascript
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.