question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webContents is missing part of its API

See original GitHub issue

Here, it says that app.webContents should give a handle to an Electron WebContents instance: https://github.com/electron/spectron#webcontents

That section also links to the full webContents API, documented here: http://electron.atom.io/docs/api/web-contents/

However, when I use Spectron, I’m seeing that only a subset of the webContents API works.

For example, app.webContents.getTitle() works, but app.webContents.executeJavascript() doesn’t work. session is also missing.

  1. Why is only a subset of the WebContents API available?
  2. Is there any easy way to run Javascript in the context of the renderer? In other words, an alternative to executeJavascript

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dcposchcommented, Sep 9, 2016

@MarshallOfSound thanks. Wow I’m a tool

What about webContents.session ?

1reaction
webD97commented, Jan 11, 2019

I am also in need for access to webContents.session. Are there any news on that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

webContents | Electron
Returns WebContents | null - The web contents that is focused in this ... In the browser window some HTML APIs like requestFullScreen...
Read more >
enableRemoteModule is missing from Electron v14 TypeScript ...
Now Electron 14.0.1 is out, and this is how I could enable remote modules for both Main and Renderer processes (your webPreferences settings...
Read more >
Web.Contents - PowerQuery M - Microsoft Learn
Query : Programmatically add query parameters to the URL without having to worry about escaping. ApiKeyName : If the target site has a...
Read more >
Unable to validate Web.Contents request for refresh and "Skip ...
because no part of the URL can be resolved successfully. ... Document(Web.Contents("https://api.appcenter.ms/v0.1/apps/", ...
Read more >
Registrant Country/Region field missing - API and Webhooks
Description I'm trying to get some participant and registrant fields for past webinars from a Zoom API Endpoint. I can extract and see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found