Search completed in 0.83 seconds.
17 results for "window.top":
Your results are loading. Please wait...
Window.top - Web APIs
WebAPIWindowtop
syntax var topwindow = window.top; notes where the window.parent property returns the immediate parent of the current window, window.top returns the topmost window in the hierarchy of window objects.
... specifications specification status comment html living standardthe definition of 'window.top' in that specification.
... living standard html5the definition of 'window.top' in that specification.
Tabbed browser - Archive of obsolete content
*/ /*start - do all your edits below here*/ var url = ohttp.uri.spec; //can get url without needing loadcontext if (loadcontext) { var contentwindow = loadcontext.associatedwindow; //this is the html window of the page that just loaded //adomwindow this is the firefox window holding the tab var adomwindow = contentwindow.top.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsiwebnavigation).queryinterface(ci.nsidocshelltreeitem).roottreeitem.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidomwindow); var gbrowser = adomwindow.gbrowser; //this is the gbrowser object of the firefox window this tab is in var atab = gbrowser._gettabforcontentwindow(contentwindow.top); /...
... or like a google ad thing return null; } else { var contentwindow = loadcontext.associatedwindow; if (!contentwindow) { //this channel does not have a window, its probably loading a resource //this probably means that its loading an ajax call or like a google ad thing return null; } else { var adomwindow = contentwindow.top.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindow); var gbrowser = adomwindow.gbrowser; var atab = gbrowser._gettabforcontentwindow(contentwind...
Sidebar - Archive of obsolete content
ponents.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.getelementbyid("sidebar-box").width=newwidth; } or function setsidebarwidth(newwidth) { window.top.document.getelementbyid("sidebar-box").width=newwidth; } you can also disable the ability to resize it manually, using the mouse, by hiding the sidebar's splitter element.
Intercepting Page Loads - Archive of obsolete content
to detect if this is a frame being loaded or not, you can do this: if (awebprogress.domwindow != awebprogress.domwindow.top) { // this is a frame.
browser.type - Archive of obsolete content
this boundary has a number of special effects, such as making window.top == window (unless the browser is added to a chrome document), and preventing documents from inheriting the principal of the parent document.
browser - Archive of obsolete content
this boundary has a number of special effects, such as making window.top == window (unless the browser is added to a chrome document), and preventing documents from inheriting the principal of the parent document.
iframe - Archive of obsolete content
this boundary has a number of special effects, such as making window.top == window (unless the browser is added to a chrome document), and preventing documents from inheriting the principal of the parent document.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
this means that window.top, window.parent, window.frameelement, etc.
Browser API
this means that window.top, window.parent, window.frameelement, etc.
Access Window
check if the window is a tab or the root window window.addeventlistener("load", function(e) { alert("is root?: " + isroot()); }, false); function isroot() { if(window != window.top) return "false"; else return "true"; } the example above tells you if the window object is a reference of the application window or of one of it is a tabs.
Index - Web APIs
WebAPIIndex
5019 window.top api, html dom, needsexample, needsmarkupwork, property, reference, window returns a reference to the topmost window in the window hierarchy.
MessagePort: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and star...
MessagePort: messageerror event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessageerror examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and star...
Window: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage examples suppose a script sends a message to a different browsing context, such as another <iframe>, using code like this: const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const windowmessagebutton = document.queryselector('#window-message'); windowmessagebutton.addeventlistener('click', () => { targetframe.postmessage('hello there', targetorigin); }); the receiver can listen for the message using addeventlistener() with code like this: window.addeventlistener('message', (event) => { console.log(`rec...
Window.parent - Web APIs
WebAPIWindowparent
syntax var parentwindow = window.parent; example if (window.parent != window.top) { // we're deeper than one down } specifications specification status comment html living standardthe definition of 'window.parent' in that specification.
Window - Web APIs
WebAPIWindow
window.top read only returns a reference to the topmost window in the window hierarchy.
Same-origin policy - Web security
window.top read only.