electron / electron/electron

[Bug]: Context-isolated preload doesn’t see event.favicons in <webview> page-favicon-updated handler

Open
#31,924 33 comments 0 reactions 0 assignees View on GitHub
16-x-y 17-x-y bug :beetle: platform/linux
Dominant language
C++
Stars
123k
Forks
17.5k
Avg merge
14h 31m
Merged PRs (30d)
858

Description

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

16.0.1, 17.0.0-alpha.2, 18.0.0-nightly.20211118, older versions at least as old as 4.0.0

### What operating system are you using?

Other Linux

### Operating System Version

NixOS 21.11

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

The [`page-favicon-updated` event](https://www.electronjs.org/docs/latest/api/webview-tag#event-page-favicon-updated) of the `` tag should have a `favicons` member that’s an array of strings.

### Actual Behavior

If context isolation is enabled, the preload script

```js
document.querySelector("webview").addEventListener("page-favicon-updated", (event) => {
console.log("favicons" in event);
});
```

correctly shows `true` from the main world (a `` tag), but incorrectly shows `false` from the preload script.

### Testcase Gist URL

https://gist.github.com/b691261807a17b6f63bbcfd363544bb3

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.