mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 754141 (1/4) - Get the mozapp attribute value from the parent instead of its presence. r=jlebar
This commit is contained in:
parent
8a3d63dec8
commit
70dc2d8dfb
@ -54,11 +54,12 @@ BrowserElementChild.prototype = {
|
||||
// This is because mozapp iframes have some privileges which we don't want
|
||||
// to extend to untrusted mozbrowser content.
|
||||
//
|
||||
// Set the window's isApp state by asking our parent if our iframe has the
|
||||
// 'mozapp' attribute.
|
||||
// Get the app manifest from the parent, if our frame has one.
|
||||
let appManifestURL = sendSyncMsg('get-mozapp-manifest-url')[0];
|
||||
|
||||
content.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIDOMWindowUtils)
|
||||
.setIsApp(sendSyncMsg('get-mozapp')[0]);
|
||||
.setIsApp(!!appManifestURL);
|
||||
|
||||
addEventListener('DOMTitleChanged',
|
||||
this._titleChangedHandler.bind(this),
|
||||
|
@ -100,7 +100,7 @@ BrowserElementParent.prototype = {
|
||||
addMessageListener("loadend", this._fireEventFromMsg);
|
||||
addMessageListener("titlechange", this._fireEventFromMsg);
|
||||
addMessageListener("iconchange", this._fireEventFromMsg);
|
||||
addMessageListener("get-mozapp", this._sendAppState);
|
||||
addMessageListener("get-mozapp-manifest-url", this._sendMozAppManifestURL);
|
||||
|
||||
mm.loadFrameScript("chrome://global/content/BrowserElementChild.js",
|
||||
/* allowDelayedLoad = */ true);
|
||||
@ -135,8 +135,8 @@ BrowserElementParent.prototype = {
|
||||
frameElement.dispatchEvent(evt);
|
||||
},
|
||||
|
||||
_sendAppState: function(frameElement, data) {
|
||||
return frameElement.hasAttribute('mozapp');
|
||||
_sendMozAppManifestURL: function(frameElement, data) {
|
||||
return frameElement.getAttribute('mozapp');
|
||||
},
|
||||
|
||||
observe: function(subject, topic, data) {
|
||||
|
Loading…
Reference in New Issue
Block a user