Is there a way to access browsing context in JavaScript?
Update: I'm reading HTML5 specification and there, it says that for each new tab, or new window, or iframe there is a notion of browsing context which is created by browser and each new document that you surf (each new link) would be stored and presented to users in this browsing context.
I just wonder if we have access to it. For example, a browsing context has a history and we can access that using window.history
.
A browsing context is an environment in which Document objects are presented to the user. A tab or window in a Web browser typically contains a browsing context, as does an iframe or frame s in a frameset . Each browsing context has a corresponding WindowProxy object.
A browsing context that has no parent browsing context is the top-level browsing context for itself and all of the browsing contexts for which it is an ancestor browsing context. A top-level browsing context has an associated group (null or a browsing context group). It is initially null.
1 Nested browsing contexts. Certain elements (for example, iframe elements) can instantiate further browsing contexts. These are called nested browsing contexts .
The contextmenu attribute specifies a context menu for an element. The context menu appears when a user right-clicks on the element. The value of the contextmenu attribute is the id of the <menu> element to open.
Yes with the window object
see what w3 says about it
You can use window.top
to access the top most context for instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With