Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access "browsing context" in JavaScript?

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.

like image 468
Saeed Neamati Avatar asked Aug 04 '11 13:08

Saeed Neamati


People also ask

What is a browsing context?

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.

What is top level browsing context?

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.

What is a nested browsing context?

1 Nested browsing contexts. Certain elements (for example, iframe elements) can instantiate further browsing contexts. These are called nested browsing contexts .

What is context in HTML?

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.


1 Answers

Yes with the window object

see what w3 says about it

You can use window.top to access the top most context for instance.

like image 166
Joseph Marikle Avatar answered Sep 23 '22 17:09

Joseph Marikle