-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webview.executeScript wrong context #6229
Comments
It's executed in the right context. It's just the issue of accessing returned window object. Will look into this. If you execute |
Turns out it's executed in a isolated world on purpose by upstream: https://stackoverflow.com/a/24435983/180197 Will remove this limitation for NW app. |
This is fixed in git and will be available in the next nightly build. |
I have some workaround code that depends on the code being executed in the extension "isolated world" context. Is it possible, in the future, to have extra fields in the |
@phiSgr yes. Please file another issue for this feature. |
Will add a boolean field |
@rogerwang are those new options already available? Or coming up in the new release? |
Yes see
http://nwjs.readthedocs.io/en/nw27/References/webview%20Tag/#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" ***@***.***> 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
<#6229 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAKGGRDXsBhRlnZGhfXU754Anzx_CLMXks5s9ofpgaJpZM4QFIg0>
.
|
- Add test for isseu nwjs#6229 - This case is failed on failed version 0.26.0, pass on fixed version 0.27.4
- Add test for isseu nwjs#6229 - This case is failed on failed version 0.26.0, pass on fixed version 0.27.4
- Add test for isseu nwjs#6229 - This case is failed on failed version 0.26.0, pass on fixed version 0.27.4
- Add test for isseu #6229 - This case is failed on failed version 0.26.0, pass on fixed version 0.27.4
- Add test for issue nwjs#6229 - This case is failed on failed version 0.26.0, pass on fixed version 0.27.4
- Add test for issue #6229 - This case is failed on failed version 0.26.0, pass on fixed version 0.27.4
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
The text was updated successfully, but these errors were encountered: