-
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
Window opened with new_instance creates always mixed context #7344
Comments
After further reading of http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/ Seems that the new_instance creates a new window always in mixed context mode! As our main window have separate browser and node context, we would like with new_instance to create just a new window with new separate browser and node contexts - not suddenly switch to mixed context! Can this be done or do we need a new option to create new_instances in separate context mode? |
This is fixed in git and will be available in the next nightly build. |
if open a new_intance window that is a seperate context , how could i inspect the new created node context? |
NWJS Version : 0.43.6
Operating System : Windows 10
Expected behavior
When new window is opened with window.open and new_instance, it should open just as normal window.open as browser window context.
Actual behavior
However when opened with new_instance, the global variable "module" is defined and this indicates CommonJS environtment. So this results that jQuery for example can not be loaded as script include as it detects commonJS environment.
How to reproduce
Use the this test case:
test_popup_window.zip
You will see that when the same popup is open regularly - the module is underfined and jquery can load fine, but when opened with new_instance - module is defined and jquery fails to load.
I hope that is not by design @rogerwang ? Or is there an extra option to choose the type of browser context?
The text was updated successfully, but these errors were encountered: