profile
viewpoint
Cheng Zhao zcbenz Microsoft Nagoya, Japan

yue/node-gui 271

Node.js bindings to the Yue library.

zcbenz/BPlusTree 144

B+ tree implementation which stores data in file

zcbenz/chromium-source-tarball 136

Generate source tarball of Chromium automatically

electron/node-rcedit 129

Node module to edit resources of exe

zcbenz/cefode 41

Custom CEF build that has node.js API integration.

fengmk2/node-curl 34

This module no longer work, please use https://github.com/node-modules/urllib-sync instead.

zcbenz/brackets 29

An open source code editor for the web, written in JavaScript, HTML and CSS.

electron/be 14

Scripts to help building Electron

zcbenz/dotfiles 14

My dotfiles for POSIX systems and cygwin.

zcbenz/d3-browserify 10

D3 distribution that used for browserify-like environment

Pull request review commentelectron/electron

feat(extensions): add more properties to extension object

 v8::Local<v8::Value> Converter<const extensions::Extension*>::ToV8(   auto dict = gin::Dictionary::CreateEmpty(isolate);   dict.Set("id", extension->id());   dict.Set("name", extension->name());+  dict.Set("path", extension->path());+  dict.Set("url", extension->url());   dict.Set("version", extension->VersionString());++  auto manifest = extension->manifest()->value()->Clone();

I think you can just do dict.Set("manifest", *(extension->manifest()->value()));?

samuelmaddock

comment created time in 19 hours

Pull request review commentelectron/electron

feat(extensions): add more properties to extension object

 v8::Local<v8::Value> Converter<const extensions::Extension*>::ToV8(   auto dict = gin::Dictionary::CreateEmpty(isolate);   dict.Set("id", extension->id());   dict.Set("name", extension->name());+  dict.Set("path", extension->path());+  dict.Set("url", extension->url());   dict.Set("version", extension->VersionString());++  auto manifest = extension->manifest()->value()->Clone();

There is no need for clone, converting a base::Value to V8 already implies cloning.

samuelmaddock

comment created time in 20 hours

Pull request review commentelectron/electron

feat(extensions): add more properties to extension object

  #include "shell/common/gin_converters/extension_converter.h" +#include "content/public/renderer/v8_value_converter.h"

This header is not needed.

samuelmaddock

comment created time in 20 hours

delete branch electron/electron

delete branch : trop/9-x-y-bp-fix-add-patch-to-route-mouse-event-navigations-through-the-webcontentdelegate-1581725641619

delete time in 20 hours

push eventelectron/electron

trop[bot]

commit sha f22376ef328d94382cfd32665ddd7faf476b8755

fix: add patch to route mouse event navigations through the WebContentsDelegate (#22204) Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

view details

push time in 20 hours

PR merged electron/electron

fix: add patch to route mouse event navigations through the WebContentDelegate 9-x-y backport

Backport of #22202

See that PR for details.

Notes: Fixed issue where navigating with the mouse buttons 4/5 would result in full page loads instead of in-page popstate navigations

+35 -0

0 comment

2 changed files

trop[bot]

pr closed time in 20 hours

delete branch electron/electron

delete branch : trop/9-x-y-bp-docs-remove-accidental-deprecation-1582061865882

delete time in 20 hours

push eventelectron/electron

trop[bot]

commit sha 324b49a5eb74ceb5bf92f88e774392ee750f2884

doc: remove accidental deprecation (#22264) Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

view details

push time in 20 hours

PR merged electron/electron

docs: remove accidental deprecation 9-x-y backport

Backport of #22256

See that PR for details.

Notes: none

+0 -2

0 comment

1 changed file

trop[bot]

pr closed time in 20 hours

push eventelectron/electron

trop[bot]

commit sha 6ef605eaa2e9b6ebdc888ed18451d8cc5d686d5e

doc: remove accidental deprecation (#22266) Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

view details

push time in 20 hours

push eventelectron/electron

trop[bot]

commit sha 1db64c9e51876315085a83ccc2d644d9fb1790e7

doc: remove accidental deprecation (#22265) Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

view details

push time in 20 hours

delete branch electron/electron

delete branch : trop/7-1-x-bp-docs-remove-accidental-deprecation-1582061877720

delete time in 20 hours

delete branch electron/electron

delete branch : trop/8-x-y-bp-docs-remove-accidental-deprecation-1582061866348

delete time in 20 hours

PR merged electron/electron

docs: remove accidental deprecation 8-x-y backport

Backport of #22256

See that PR for details.

Notes: none

+0 -2

0 comment

1 changed file

trop[bot]

pr closed time in 20 hours

PR merged electron/electron

docs: remove accidental deprecation 7-1-x backport

Backport of #22256

See that PR for details.

Notes: none

+0 -2

0 comment

1 changed file

trop[bot]

pr closed time in 20 hours

pull request commentelectron/electron

chore: update chromium to 82.0.4058.2

There is a patch needs to be updated.

nornagon

comment created time in 3 days

delete branch electron/electron

delete branch : dev-docs

delete time in 3 days

push eventelectron/electron

Jeremy Apthorp

commit sha 360326ecad09a6642b9fcd5e3477594d1aa53f74

docs: update dev docs atom -> shell (#22199)

view details

push time in 3 days

PR merged electron/electron

docs: update dev docs atom -> shell

Update some developer docs to reflect the current directory hierarchy.

Notes: none

+3 -3

0 comment

3 changed files

nornagon

pr closed time in 3 days

delete branch electron/electron

delete branch : electronjs-org

delete time in 3 days

push eventelectron/electron

Jeremy Apthorp

commit sha f8c4be7caa84a3685c0ff62cfefcee3c6787e173

docs: replace electron.atom.io with electronjs.org in docs/fiddles (#22196)

view details

push time in 3 days

PR merged electron/electron

docs: replace electron.atom.io with electronjs.org in docs/fiddles

electron.atom.io redirects to electronjs.org anyway, might as well skip the middleman.

also http -> https.

Notes: none

+26 -26

0 comment

19 changed files

nornagon

pr closed time in 3 days

delete branch electron/electron

delete branch : fix-dsym-zip

delete time in 3 days

push eventelectron/electron

John Kleinschmidt

commit sha 7a7754a3dd87a154fb5e498f559201e5e0d9c06c

fix: don't include breakpad_symbols dir in dsym.zip (#22191)

view details

push time in 3 days

PR merged electron/electron

fix: don't include breakpad_symbols dir in dsym.zip target/6-1-x target/7-1-x target/8-x-y target/9-x-y

Description of Change

<!-- Thank you for your Pull Request. Please provide a description above and review the requirements below.

Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md --> There was a bug in the make_zip python function on macOS where it was modifying the list of files passed into it to include the directory passed in. This caused the dsym.zip file to be created with the breakpad_symbols directory because a previous call to make_zip had that directory as an argument, which caused it to get added to the list of license files which are added to dsym.zip.

This PR fixes the issue by changing the make_zip function to not modify the passed in arguments so that if those arguments are used downstream they won't be compromised.

Resolves #22139

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

Release Notes

Notes: <!-- Please add a one-line description for app developers to read in the release notes, or no-notes if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/master/README.md#examples -->Removed unneccessary breakpad_symbols directory from the dsym zip file.

+2 -2

0 comment

1 changed file

jkleinsc

pr closed time in 3 days

issue closedelectron/electron

dsym archive contains breakpad symbols on mac

The distribution archive for macOS with native dSYM symbols contains also breakapd_symbols directory. This directory has the same contents as archive with breapad symbols.

For example: electron-v9.0.0-beta.1-darwin-x64-dsym.zip also contains directory breakpad_symbols which is in electron-v9.0.0-beta.1-darwin-x64-symbols.zip

To fix, please remove breapad_symbols from -dsym archive and leave it only in -symbols archive.

Preflight Checklist

  • [x] I have read the Contributing Guidelines for this project.
  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 4.0.0 - latest
    • macOS, all versions
  • Last Known Working Electron version:
    • I don't know

Expected Behavior

electron-vX.Y.Z-darwin-x64-dsym.zip contains just dSYM symbols.

Actual Behavior

electron-vX.Y.Z-darwin-x64-dsym.zip contains dSYM symbols and breakpad_symbols.

To Reproduce

Download electron-vX.Y.Z-darwin-x64-dsym.zip from any version released in last years.

Screenshots

Screenshot 2020-02-11 at 09 54 48

closed time in 3 days

torycl

push eventelectron/electron

Shelley Vohr

commit sha c30ecc38d0537f00476f91f2142b6f0f45e7f12d

fix: crash on custom printing margins (#22164) (#22187)

view details

push time in 3 days

delete branch electron/electron

delete branch : printing-margins-bp-7

delete time in 3 days

PR merged electron/electron

fix: crash on custom printing margins 7-1-x backport

Backport of https://github.com/electron/electron/pull/22164.

See that PR for details.

Notes: Fixed a crash in webContents.print() with custom print margins.

+18 -6

1 comment

2 changed files

codebytere

pr closed time in 3 days

pull request commentelectron/electron

fix: crash on custom printing margins

Build is failing due to API changes of base::Value.

codebytere

comment created time in 6 days

push eventelectron/electron

trop[bot]

commit sha c4a836f95a9334d1d26133a704bc9592b4e2afb5

fix: crash on custom printing margins (#22185) Co-authored-by: Shelley Vohr <codebytere@github.com>

view details

push time in 6 days

delete branch electron/electron

delete branch : trop/9-x-y-bp-fix-crash-on-custom-printing-margins-1581614158088

delete time in 6 days

PR merged electron/electron

fix: crash on custom printing margins 9-x-y backport

Backport of #22164

See that PR for details.

Notes: Fixed a crash in webContents.print() with custom print margins.

+18 -6

0 comment

2 changed files

trop[bot]

pr closed time in 6 days

pull request commentelectron/electron

feat: [extensions] support extension.getBackgroundPage (#21951)

Does this need approval from @electron/wg-releases? While it is a feat I think it is more about fixing extensions.

nornagon

comment created time in 6 days

delete branch electron/electron

delete branch : trop/7-1-x-bp-fix-no-arg-console-log-is-undefined-1581528327756

delete time in 6 days

push eventelectron/electron

trop[bot]

commit sha 14d9b8a8b47ffb6962bdff651cd96d02f6c1970f

fix: no-arg console.log is undefined (#22173) Co-authored-by: Shelley Vohr <codebytere@github.com>

view details

push time in 6 days

PR merged electron/electron

fix: no-arg console.log is undefined 7-1-x backport

Backport of #22165

See that PR for details.

Notes: Fixes an issue where undefined was printed from console.log on Window when no arguments were passed.

+4 -2

0 comment

1 changed file

trop[bot]

pr closed time in 6 days

delete branch electron/electron

delete branch : trop/8-x-y-bp-fix-no-arg-console-log-is-undefined-1581528327279

delete time in 6 days

push eventelectron/electron

trop[bot]

commit sha ceb3b0cf54b390b73e96512d4b6d435f4ee06014

fix: no-arg console.log is undefined (#22172) Co-authored-by: Shelley Vohr <codebytere@github.com>

view details

push time in 6 days

PR merged electron/electron

fix: no-arg console.log is undefined 8-x-y backport

Backport of #22165

See that PR for details.

Notes: Fixes an issue where undefined was printed from console.log on Window when no arguments were passed.

+4 -2

0 comment

1 changed file

trop[bot]

pr closed time in 6 days

push eventelectron/electron

trop[bot]

commit sha 9b2de2583e010fc27eff93e6d6f146f2dbdcf9c8

fix: no-arg console.log is undefined (#22171) Co-authored-by: Shelley Vohr <codebytere@github.com>

view details

push time in 6 days

delete branch electron/electron

delete branch : trop/9-x-y-bp-fix-no-arg-console-log-is-undefined-1581528325683

delete time in 6 days

PR merged electron/electron

fix: no-arg console.log is undefined 9-x-y backport

Backport of #22165

See that PR for details.

Notes: Fixes an issue where undefined was printed from console.log on Window when no arguments were passed.

+4 -2

0 comment

1 changed file

trop[bot]

pr closed time in 6 days

push eventelectron/electron

Cheng Zhao

commit sha 40a212e132d9c6e305fc508e60d1de7ffd65b7d8

fix: make webRequest work with WebSocket (7-1-x) (#22141) * fix: make webRequest work with WebSocket * test: install modules for spec-main

view details

push time in 8 days

delete branch electron/electron

delete branch : web-request-web-socket-7-1-x

delete time in 8 days

PR merged electron/electron

fix: make webRequest work with WebSocket (7-1-x) 7-1-x backport

Backport of https://github.com/electron/electron/pull/22040.

Notes: Fix webRequest API not working with WebSockets.

+906 -63

2 comments

15 changed files

zcbenz

pr closed time in 8 days

delete branch electron/electron

delete branch : web-request-web-socket-8-x-y

delete time in 8 days

push eventelectron/electron

Cheng Zhao

commit sha dc9654c03c8851d3fdd59da9ee1bb60aedaf3dd5

fix: make webRequest work with WebSocket (#22134)

view details

push time in 8 days

PR merged electron/electron

fix: make webRequest work with WebSocket (8-x-y) 8-x-y backport

Backport of https://github.com/electron/electron/pull/22040.

Notes: Fix webRequest API not working with WebSockets.

+895 -59

0 comment

14 changed files

zcbenz

pr closed time in 8 days

pull request commentelectron/electron

fix: make webRequest work with WebSocket (7-1-x)

I have fixed the failing tests, this is ready for review.

zcbenz

comment created time in 8 days

pull request commentelectron/electron

feat: enable pdf viewer

Building is failing.

nornagon

comment created time in 8 days

pull request commentelectron/electron

chore: prevent user code polluting internal EventEmitter's

@nornagon Have your question been resolved in this PR?

MarshallOfSound

comment created time in 8 days

push eventelectron/electron

Shelley Vohr

commit sha cb9b3b29afcd6a16b6bdb25c7592e55e1a61022f

fix: keep references to active menus created by api Menu (#22151) Without this such menus would be destroyed by js garbage collector even when they are still displayed. Co-authored-by: CezaryKulakowski <50166166+CezaryKulakowski@users.noreply.github.com>

view details

push time in 8 days

delete branch electron/electron

delete branch : menu-active-ref-7

delete time in 8 days

PR merged electron/electron

Reviewers
fix: keep references to active menus created by api Menu 7-1-x backport

Backport of https://github.com/electron/electron/pull/19427.

See that PR for more details.

Notes: Fix a potential issue with active Menu garbage collection.

+10 -0

0 comment

1 changed file

codebytere

pr closed time in 8 days

push eventelectron/electron

Cheng Zhao

commit sha 9f96190d8b03f85d019b2a0f452b5e284138b5a9

test: install modules for spec-main

view details

push time in 8 days

PR opened electron/electron

Reviewers
fix: make webRequest work with WebSocket (7-1-x)

Backport of https://github.com/electron/electron/pull/22040.

Notes: Fix webRequest API not working with WebSockets.

+898 -59

0 comment

14 changed files

pr created time in 9 days

create barnchelectron/electron

branch : web-request-web-socket-7-1-x

created branch time in 9 days

PR opened electron/electron

Reviewers
fix: make webRequest work with WebSocket (8-x-y)

Backport of https://github.com/electron/electron/pull/22040.

Notes: Fix webRequest API not working with WebSockets.

+895 -59

0 comment

14 changed files

pr created time in 9 days

push eventelectron/electron

Cheng Zhao

commit sha d482adcddd47eef7dc4d4fc4e22d3d609adc6f21

fix: make webRequest work with WebSocket

view details

push time in 9 days

create barnchelectron/electron

branch : web-request-web-socket-8-x-y

created branch time in 9 days

push eventelectron/electron

trop[bot]

commit sha 91141028e612dbb1c1117f3ef25215bc3e728646

chore: print more logging for failed tests (#22116) Co-authored-by: Cheng Zhao <zcbenz@github.com>

view details

push time in 9 days

delete branch electron/electron

delete branch : trop/9-x-y-bp-chore-print-more-logging-for-failed-tests-1581321164991

delete time in 9 days

PR merged electron/electron

chore: print more logging for failed tests 9-x-y backport

Backport of #22060

See that PR for details.

Notes: no-notes

+12 -2

0 comment

2 changed files

trop[bot]

pr closed time in 9 days

push eventelectron/electron

Cheng Zhao

commit sha c608d6d7fb6568dd668467b3bed734ee24254823

fix: make webRequest work with WebSocket (#22040) * fix: web request support proxying websocket * fix: make tests work * chore: do not use api:: code outside api/ folder * chore: do not create proxy when no listener * test: use separate session to avoid conflicts * chore: address review

view details

push time in 9 days

delete branch electron/electron

delete branch : web-request-web-socket

delete time in 9 days

PR merged electron/electron

fix: make webRequest work with WebSocket target/7-1-x target/8-x-y target/9-x-y

Description of Change

Close https://github.com/electron/electron/issues/21308.

This PR replaces https://github.com/electron/electron/pull/21754.

Checklist

Release Notes

Notes: Fix webRequest API not working with WebSockets.

+897 -59

0 comment

14 changed files

zcbenz

pr closed time in 9 days

issue closedelectron/electron

onBeforeSendHeaders behavior changed

<!-- As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can. -->

Preflight Checklist

<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

  • [x] I have read the Contributing Guidelines for this project.
  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version: 7.1.2
    • <!-- (output of node_modules/.bin/electron --version) e.g. 4.0.3 -->
  • Operating System: macOS 10.15.1
    • <!-- (Platform and Version) e.g. macOS 10.13.6 / Windows 10 (1803) / Ubuntu 18.04 x64 -->
  • Last Known Working Electron version: 6.1.5
    • <!-- (if applicable) e.g. 3.1.0 -->

Expected Behavior

<!-- A clear and concise description of what you expected to happen. --> Outgoing WebSocket connections should be captured.

Actual Behavior

<!-- A clear and concise description of what actually happened. --> Outgoing WebSocket connections do not trigger the listener.

To Reproduce

// main.js
  session.defaultSession.webRequest.onBeforeSendHeaders({ urls: ['ws://*/*', 'wss://*/*'] }, (details, callback) => {
    console.log(details);
    callback(details);
  });

// renderer process
new WebSocket('ws://localhost:8080/') // port different from window.location.port

<!-- Your best chance of getting this bug looked at quickly is to provide an example. -->

<!-- For bugs that can be encapsulated in a small experiment, you can use Electron Fiddle (https://github.com/electron/fiddle) to publish your example to a GitHub Gist and link it your bug report. -->

<!-- If Fiddle is insufficient to produce an example, please provide an example REPOSITORY that can be cloned and run. You can fork electron-quick-start (https://github.com/electron/electron-quick-start) and include a link to the branch with your changes. -->

<!-- If you provide a URL, please list the commands required to clone/setup/run your repo e.g.

$ git clone $YOUR_URL -b $BRANCH
$ npm install
$ npm start || electron .

-->

Screenshots

<!-- If applicable, add screenshots to help explain your problem. -->

Additional Information

<!-- Add any other context about the problem here. --> There is an additional argument to onBeforeSendHeaders which is inaccessible from Electron.

https://developers.chrome.com/extensions/webRequest#implementation

closed time in 9 days

oscar-broman

push eventelectron/electron

Cheng Zhao

commit sha d1ec1fbaf60f1922207c923c837aaf6a8ca78a6e

chore: address review

view details

push time in 9 days

push eventelectron/electron

Shelley Vohr

commit sha 83124889e5dabbc5c67c41d43c5dc9d5b38f921e

feat: enable passing Node.js cli flags (#21110) * feat: enable passing Node.js cli flags * Allow cli flags in ELECTRON_RUN_AS_NODE mode

view details

John Kleinschmidt

commit sha f1f185ee937fcf22832172b3ce13a29db4dcd726

test: get native unit tests running (#21914)

view details

Electron Bot

commit sha 6a7d722c0604f679dc00f67a094ee9f1ebd09dd4

Bump v10.0.0-nightly.20200207

view details

Jeremy Apthorp

commit sha e2a5de9248501167d6a0b7842d96e6f51b6a6c69

refactor: saner blink_initialization_order.patch (#22054)

view details

John Kleinschmidt

commit sha 45591e31ceeaa91d136330c149f0bd0c22ed04ab

ci: fix build failure on doc only changes (#22075) * ci: fix build failure on doc only changes * ci: fix doc-only check when CI fires on branch before PR is created

view details

John Kleinschmidt

commit sha c6cec9728705e0e67144db1773753b01d175a125

build: copy chromedriver to correct location (#22074) * build: copy chromedriver to correct location * build: try to free up disk space for macos releases * get verbose mode working on strip-binaries * Only use separate chromedriver build arm/arm64

view details

Jeremy Apthorp

commit sha ea89120c9e5a7d9725be03f71ff4c64e6fffe1de

chore: remove debugging log (#22093)

view details

John Kleinschmidt

commit sha 5e49aafe55137d5e3bc80c9ac9a8562db550f984

build: preserve timestamps when stripping files (#22094) * build: preserve timestamps when stripping files Resolves an issue where the binaries in mksnapshot.zip were not getting stripped. * Add missing comma * Update script/strip-binaries.py Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org> * Don't try to run strip on macOS Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>

view details

Electron Bot

commit sha f989faab5c83fea982a6961dbcfae22074df408d

Bump v10.0.0-nightly.20200208

view details

John Kleinschmidt

commit sha 058222a9f1527698180e18e2ad64f1b714451d60

build: try using newer version of xcode/macOS sdk (#22104)

view details

t57ser

commit sha 43592f8b719f8d5ec7031f0e1e664d63e42ca064

fix: flash plugin (#22072) * fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 * cleanup * fix linting issue

view details

Samuel Attard

commit sha dafbf04b9a89141d72ee7338b4acbb77a7269799

fix: use a WeakPtr so we do not UAF the store in FunctionLifetimeMonitor (#22056)

view details

Electron Bot

commit sha 099246f0e4a1d67165dd7b8f0346f4ec67ff5646

Bump v10.0.0-nightly.20200209

view details

Shelley Vohr

commit sha d5e79046107896abd9ff74ff0fc1f049bcf102f3

refactor: remove use of Node's DebugOptions (#22083)

view details

CoderPoet

commit sha 97cf24ac98333187eaea2eaf2c64a72f5bcba64b

docs: modify the showMessageBox method to showMessageBoxSync (#22080) In handling the will-prevent-unload event, preventDefault should be executed synchronously, and here should also be showMessageBoxSync

view details

Electron Bot

commit sha c2cd588e70ba92920d8dc45eb51fb596cfd36be3

Bump v10.0.0-nightly.20200210

view details

Jeremy Apthorp

commit sha af631f8204e07a00c7549a84d16d79d842b32de7

fix: disallow loading extensions in temp sessions (#22090) * fix: disallow loading extensions in temp sessions * docs

view details

Jeremy Apthorp

commit sha b77f701aeba49630735b5b04b4835f01f130a616

feat: disable the remote module by default (#22091)

view details

Andy Dill

commit sha 8ca4e761fd5f5e8404a48c385819cea0fbe9fc6a

fix: explicitly specify `typeRoots` to avoid crawling parent directories (#22078)

view details

Erick Zhao

commit sha 17abeca8b775dbd971229569d25512d0614415f2

feat: add session.removeWordFromSpellCheckerDictionary API (#22039) * feat: add session.removeWordFromSpellCheckerDictionary API * rebase fixup

view details

push time in 9 days

delete branch electron/electron

delete branch : fix-browserwindow-cyclic-ref

delete time in 9 days

push eventelectron/electron

Cheng Zhao

commit sha 9ad6f0683157027a2b724670140b21c815a24d1b

fix: remove cyclic references of BrowserWindow (#22006) * fix: remove cyclic references in BrowserWindow * fix: prevent TopLevelWindow from garbage collection * test: garbage collection of BrowserWindow * chore: createIDWeakMap is used in tests

view details

push time in 9 days

PR merged electron/electron

Reviewers
fix: remove cyclic references of BrowserWindow

Description of Change

Refs https://github.com/electron/electron/pull/21957.

This PR fixes the cyclic references caused by WebContents referencing the owning window. The fix is implemented with C++, as weak reference would be much more complicated with JavaScript, and it also has the benefit of avoiding exposing internal implementation to public JavaScript.

And in order to align with previous behavior that the window does not get garbage collected when opened, the window is now explicitly referenced by a global map, and explicitly removed from the map when closed.

Note that memory taken by JavaScript objects can only be freed via garbage collection, so even though the native window object is freed when closed, the corresponding JavaScript objects would still be leaked if cyclic references happens, and this fix is required to ensure memory used by the BrowserWindow and WebContents JavaScript objects are not leaked.

For the tests, ideally we should have a test to ensure window does get garbage collected when closed, however by inserting the window to a global map, the object would be moved to different garbage collection phase, and it becomes uncertain when it would be garbage collected. Currently I can only manually verify the window would be garbage collected eventually.

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

Release Notes

Notes: Fix the JavaScript object of BrowserWindow not garbage collected when window is closed.

+76 -32

2 comments

9 changed files

zcbenz

pr closed time in 9 days

delete branch electron/electron

delete branch : test-ci-web-contents-view

delete time in 10 days

delete branch electron/electron

delete branch : zcbenz-test

delete time in 10 days

delete branch electron/electron

delete branch : fix-tray-conversion-test

delete time in 10 days

delete branch electron/electron

delete branch : mas-patch-remote-layer-7-1-x

delete time in 10 days

Pull request review commentelectron/electron

feat: add session.removeWordFromSpellCheckerDictionary API

 bool Session::AddWordToSpellCheckerDictionary(const std::string& word) { #endif   return service->GetCustomDictionary()->AddWord(word); }++bool Session::RemoveWordFromSpellCheckerDictionary(const std::string& word) {+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)+  if (spellcheck::UseBrowserSpellChecker()) {+    spellcheck_platform::RemoveWord(base::UTF8ToUTF16(word));

Build is failing at this line:

../../electron/shell/browser/api/electron_api_session.cc(787,60): error: too few arguments to function call, expected 2, have 1
33730    spellcheck_platform::RemoveWord(base::UTF8ToUTF16(word));
33731    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                        ^
33732../..\components/spellcheck/browser/spellcheck_platform.h(111,1): note: 'RemoveWord' declared here
33733void RemoveWord(PlatformSpellChecker* spell_checker_instance,
33734^
337351 error generated.
33736
erickzhao

comment created time in 10 days

push eventelectron/electron

CoderPoet

commit sha 97cf24ac98333187eaea2eaf2c64a72f5bcba64b

docs: modify the showMessageBox method to showMessageBoxSync (#22080) In handling the will-prevent-unload event, preventDefault should be executed synchronously, and here should also be showMessageBoxSync

view details

push time in 10 days

PR merged electron/electron

docs: modify the showMessageBox method to showMessageBoxSync

In handling the will-prevent-unload event, preventDefault should be executed synchronously, and here should also be showMessageBoxSync

Description of Change

<!-- Thank you for your Pull Request. Please provide a description above and review the requirements below.

Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md --> Modify the showMessageBox method to showMessageBoxSync

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] PR description included and stakeholders cc'd
  • [x] relevant documentation is changed or added
  • [x] PR title follows semantic commit guidelines

Release Notes

Notes: no-notes

+1 -1

1 comment

1 changed file

CoderPoet

pr closed time in 10 days

delete branch electron/electron

delete branch : trop/8-x-y-bp-ci-fix-build-failure-on-doc-only-changes-1581098342247

delete time in 10 days

push eventelectron/electron

trop[bot]

commit sha 50dac1d908c2c84c05305bd0479a4671afc2efed

ci: fix build failure on doc only changes (#22088) * ci: fix build failure on doc only changes * ci: fix doc-only check when CI fires on branch before PR is created Co-authored-by: John Kleinschmidt <jkleinsc@github.com>

view details

push time in 10 days

PR merged electron/electron

Reviewers
ci: fix build failure on doc only changes 8-x-y backport

Backport of #22075

See that PR for details.

Notes: <!-- Please add a one-line description for app developers to read in the release notes, or no-notes if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/master/README.md#examples -->no-notes

+7 -7

0 comment

2 changed files

trop[bot]

pr closed time in 10 days

push eventelectron/electron

trop[bot]

commit sha 94246dabe33ab9c24f3c62ca31f339bf69ea330d

ci: fix build failure on doc only changes (#22089) * ci: fix build failure on doc only changes * ci: fix doc-only check when CI fires on branch before PR is created Co-authored-by: John Kleinschmidt <jkleinsc@github.com>

view details

push time in 10 days

delete branch electron/electron

delete branch : trop/9-x-y-bp-ci-fix-build-failure-on-doc-only-changes-1581098343820

delete time in 10 days

PR merged electron/electron

Reviewers
ci: fix build failure on doc only changes 9-x-y backport

Backport of #22075

See that PR for details.

Notes: <!-- Please add a one-line description for app developers to read in the release notes, or no-notes if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/master/README.md#examples -->no-notes

+7 -7

0 comment

2 changed files

trop[bot]

pr closed time in 10 days

PR merged electron/electron

chore: remove debugging log 9-x-y backport

Backport of #22093

See that PR for details.

Notes: none

+0 -1

0 comment

1 changed file

trop[bot]

pr closed time in 10 days

delete branch electron/electron

delete branch : trop/9-x-y-bp-chore-remove-debugging-log-1581107483991

delete time in 10 days

push eventelectron/electron

trop[bot]

commit sha 4fe91e56ac901eb250267f938c7fce1bab2cc0b6

chore: remove debugging log (#22095) Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>

view details

push time in 10 days

delete branch electron/electron

delete branch : trop/9-x-y-bp-build-preserve-timestamps-when-stripping-files-1581113117557

delete time in 10 days

push eventelectron/electron

trop[bot]

commit sha 0d7440d6769e9b99fa9af5362dae226437551959

build: preserve timestamps when stripping files (#22098) * build: preserve timestamps when stripping files Resolves an issue where the binaries in mksnapshot.zip were not getting stripped. * Add missing comma * Update script/strip-binaries.py Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org> * Don't try to run strip on macOS Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>

view details

push time in 10 days

PR merged electron/electron

build: preserve timestamps when stripping files 9-x-y backport

Backport of #22094

See that PR for details.

Notes: <!-- Please add a one-line description for app developers to read in the release notes, or no-notes if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/master/README.md#examples -->no-notes

+9 -7

0 comment

2 changed files

trop[bot]

pr closed time in 10 days

pull request commentelectron/electron

feat: session.listWordsFromSpellCheckerDictionary API

Can you also fix the lint warning?

erickzhao

comment created time in 10 days

Pull request review commentelectron/electron

feat: session.listWordsFromSpellCheckerDictionary API

 void DestroyGlobalHandle(v8::Isolate* isolate,   } } +class DictionaryObserver final : public SpellcheckCustomDictionary::Observer {+ private:+  std::unique_ptr<gin_helper::Promise<std::set<std::string>>> _promise;

The _ should be suffixed: promise_.

erickzhao

comment created time in 10 days

Pull request review commentelectron/electron

feat: session.listWordsFromSpellCheckerDictionary API

 void SetSpellCheckerDictionaryDownloadURL(gin_helper::ErrorThrower thrower,   SpellcheckHunspellDictionary::SetDownloadURLForTesting(url); } +v8::Local<v8::Promise> Session::ListWordsInSpellCheckerDictionary() {+  std::unique_ptr<gin_helper::Promise<std::set<std::string>>> promise =

There is no need to put promise in a unique_ptr, passing by value is enough.

gin_helper::Promise<std::set<std::string>> promise(isolate());
erickzhao

comment created time in 10 days

pull request commentelectron/electron

chore: print more logging for failed tests

/trop run backport

zcbenz

comment created time in 10 days

pull request commentelectron/electron

chore: print more logging for failed tests

/trop run backport 9-x-y

zcbenz

comment created time in 10 days

delete branch electron/electron

delete branch : trop/9-x-y-bp-build-use-newer-version-of-xcode-macos-sdk-1581197909335

delete time in 10 days

push eventelectron/electron

trop[bot]

commit sha 60edd2d3b1aa892d51b8d8be667f0e08065e5686

build: try using newer version of xcode/macOS sdk (#22106) Co-authored-by: John Kleinschmidt <jkleinsc@github.com>

view details

push time in 10 days

PR merged electron/electron

Reviewers
build: use newer version of xcode/macOS sdk 9-x-y backport

Backport of #22104

See that PR for details.

Notes: <!-- Please add a one-line description for app developers to read in the release notes, or no-notes if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/master/README.md#examples -->no-notes

+2 -2

0 comment

1 changed file

trop[bot]

pr closed time in 10 days

more