I volontari di MDN non hanno ancora tradotto questo articolo in Italiano. Unisciti a noi e traducilo tu stesso.
Puoi anche consultare l’articolo in English (US).

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Deprecated since Gecko 60 (Firefox 60 / Thunderbird 60 / SeaMonkey 2.57)
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The loadOverlay() method loads a XUL overlay and merges it with the current document, notifying an observer when the merge is complete.


document.loadOverlay(url, observer);
A string containing the absolute URL of the overlay to load.
An object implementing nsIObserver that will be notified with a message of topic "xul-overlay-merged" when the merge is complete, or null if no observer is needed. The subject parameter of observe will implement nsIURI and will contain the URI of the merged overlay.


This API is not frozen and may change later.

Subsequent document.loadOverlay calls do not work bug 330458. You have to rely on observers to queue subsequent overlay loads.

Loading an overlay with the same URI twice is not currently supported, although it may work sometimes. There's a comment in nsXULDocument::LoadOverlay to that effect.

Note: Starting in Firefox 3.5, overlays that include script elements that import their code from anything other than chrome: URLs will fail to import the scripts; this is a fix for a security issue.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No No

611 2 3 4

Yes — 611 3

No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No No No No No No ?

1. Available only to XUL documents.

2. If a XUL document attempts to load an overlay without the compile flag, an error will be thrown (see bug 1448162).

3. See bug 1449791

4. From version 61: this feature is behind the MOZ_BREAK_XUL_OVERLAYS compile flag (needs to be set to False).

See also

Tag del documento e collaboratori

Hanno collaborato alla realizzazione di questa pagina: ExE-Boss, fscholz, valtlai, teoli, Sebastianz, MHasan, kscarfone, Reachmeatshivam, Sheppy, ethertank, trevorh, ziyunfei, q0k, Jürgen Jeka, Mgjbot, Waldo, Nickolay
Ultima modifica di: ExE-Boss,