We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
globalThis
window
In the documentation : https://brython.info/static_doc/3.13/fr/jsobjects.html
Examples should use globalThis instead of window :
from browser import globalThis
Indeed, globalThis is the standard way to access global values, working in window and non-window context, cf https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
Brython does remove browser.window in Node and WebWorker contexts.
browser.window
The text was updated successfully, but these errors were encountered:
Note: browser.globalThis doesn't seem to be supported by Brython, but browser.self is.
browser.globalThis
browser.self
I think self is standard in window environment and Webworker, but might not be in other environment (even if they seem to implement it).
So at least, examples should use from browser import self to access JS global variables, but ideally globalThis.
from browser import self
Sorry, something went wrong.
Also : self would be confusing inside methods where we use self like the JS this.
self
this
No branches or pull requests
In the documentation : https://brython.info/static_doc/3.13/fr/jsobjects.html
Examples should use
globalThis
instead ofwindow
:Indeed,
globalThis
is the standard way to access global values, working in window and non-window context, cf https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThisBrython does remove
browser.window
in Node and WebWorker contexts.The text was updated successfully, but these errors were encountered: