electron / electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

Home Page:https://electronjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: webContents.insertCSS doesn't work when it is in Chromium-provided page

FlysoftBeta opened this issue · comments

Preflight Checklist

Electron Version

20.0.0-beta.3

What operating system are you using?

Windows

Operating System Version

Windows 11 version 22H2

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

The promise returned by webContents.insertCSS should resolve with the key.

Actual Behavior

When the webContents loads a Chromium-provided page (eg: view-source page(like view-source:https://google.com), xml viewer, image viewer) and I try inserting CSS to the page,
the promise returned by webContents.insertCSS keeps pending and never resolves.

Testcase Gist URL

https://gist.github.com/81b8b61d974173cb9f73c67aaa03a8fd

Additional Information

Some instructions of the gist: There are two webviews on the window, and I try using insertCSS("body { background: red; }") to make the background red, but only one of them succeed.

image

and there is only one promise resolved, too.

image

https://gist.github.com/81b8b61d974173cb9f73c67aaa03a8fd is a 404, so I'm marking this as blocked/needs-repro

Unfortunately, without a way to reproduce this issue, we're unable to continue investigation. This issue has been closed and will not be monitored further. If you're able to provide a minimal test case that reproduces this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.