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.

webview.executeScript wrong context

See original GitHub issue

NWJS Version : 0.26.0 Operating System : macos

Expected behavior

webview.executeScript({code: 'console.log(window)'}, console.log) should log the window object

Actual behavior

webview.executeScript({code: 'console.log(window)'}, console.log) logs the wrong window object

How to reproduce

webview.executeScript.example.zip

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
rogerwangcommented, Nov 7, 2017

This is fixed in git and will be available in the next nightly build.

1reaction
rogerwangcommented, Dec 6, 2017

Yes see http://nwjs.readthedocs.io/en/nw27/References/webview Tag/#executescript-in-main-world

It’s in 0.27 nightly and will be released with 0.27.0 in 1 or 2 days.

On Dec 6, 2017 8:26 PM, “George Petrov” notifications@github.com wrote:

@rogerwang https://github.com/rogerwang are those new options already available? Or coming up in the new release?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nwjs/nw.js/issues/6229#issuecomment-349624550, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKGGRDXsBhRlnZGhfXU754Anzx_CLMXks5s9ofpgaJpZM4QFIg0 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

webview.executeScript wrong context · Issue #6299 · nwjs/nw.js
In the isolated context you have full access to the dom and I don't want to inject my libraries directly in the guest...
Read more >
"Chrome Apps" webview.executeScript access guest global ...
An answer to summarize the steps required. 1) You inject a content script with webview.executeScript() into the embedded page.
Read more >
[WebView] executeScript not working...? Whats wrong?
Hello! I'm working on a client solution, using an HTML-markup as the UI, loaded into a WebView. It works great at all.
Read more >
chrome.webviewTag - Chrome Developers
Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback...
Read more >
chrome/common/extensions/api/webview_tag.json - chromium/src ...
"description": "Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation...
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