Content-Length: 299088 | pFad | http://github.com/ElectronNET/Electron.NET/commit/9f7809810f389af16a259a12ff815e3271b374eb

B8 Merge pull request #559 from nfichter/insert-css · ElectronNET/Electron.NET@9f78098 · GitHub
Skip to content

Commit 9f78098

Browse files
Merge pull request #559 from nfichter/insert-css
Add WebContents insertCSS functionality
2 parents e610c96 + a4d261a commit 9f78098

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

ElectronNET.API/WebContents.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,18 @@ public Task LoadURLAsync(string url, LoadURLOptions options)
258258
return taskCompletionSource.Task;
259259
}
260260

261+
//github.com/ <summary>
262+
//github.com/ Inserts CSS into the web page.
263+
//github.com/ See: https://www.electronjs.org/docs/api/web-contents#contentsinsertcsscss-options
264+
//github.com/ Works for both BrowserWindows and BrowserViews.
265+
//github.com/ </summary>
266+
//github.com/ <param name="isBrowserWindow">Whether the webContents belong to a BrowserWindow or not (the other option is a BrowserView)</param>
267+
//github.com/ <param name="path">Absolute path to the CSS file location</param>
268+
public void InsertCSS(bool isBrowserWindow, string path)
269+
{
270+
BridgeConnector.Socket.Emit("webContents-insertCSS", Id, isBrowserWindow, path);
271+
}
272+
261273
private JsonSerializer _jsonSerializer = new JsonSerializer()
262274
{
263275
ContractResolver = new CamelCasePropertyNamesContractResolver(),

ElectronNET.Host/api/webContents.js

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/ElectronNET/Electron.NET/commit/9f7809810f389af16a259a12ff815e3271b374eb

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy