mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1024529 - use cloneInto instead of exposedProps in b2g's shell.js, r=ochameau
--HG-- extra : rebase_source : 7c2e3ccaa931e3cbdee44d4e68c8d07b9a28a8eb
This commit is contained in:
parent
3d4b80e618
commit
68139bbdf2
@ -585,8 +585,7 @@ var shell = {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendEvent(getContentWindow(), "mozChromeEvent",
|
||||
Cu.cloneInto(details, getContentWindow()));
|
||||
this.sendCustomEvent("mozChromeEvent", details);
|
||||
},
|
||||
|
||||
receiveMessage: function shell_receiveMessage(message) {
|
||||
@ -760,16 +759,11 @@ var WebappsHelper = {
|
||||
|
||||
let manifest = new ManifestHelper(aManifest, json.origin);
|
||||
let payload = {
|
||||
__exposedProps__: {
|
||||
timestamp: "r",
|
||||
url: "r",
|
||||
manifestURL: "r"
|
||||
},
|
||||
timestamp: json.timestamp,
|
||||
url: manifest.fullLaunchPath(json.startPoint),
|
||||
manifestURL: json.manifestURL
|
||||
}
|
||||
shell.sendEvent(getContentWindow(), "webapps-launch", payload);
|
||||
};
|
||||
shell.sendCustomEvent("webapps-launch", payload);
|
||||
});
|
||||
break;
|
||||
case "webapps-ask-install":
|
||||
@ -781,11 +775,9 @@ var WebappsHelper = {
|
||||
});
|
||||
break;
|
||||
case "webapps-close":
|
||||
shell.sendEvent(getContentWindow(), "webapps-close",
|
||||
{
|
||||
__exposedProps__: { "manifestURL": "r" },
|
||||
"manifestURL": json.manifestURL
|
||||
});
|
||||
shell.sendCustomEvent("webapps-close", {
|
||||
"manifestURL": json.manifestURL
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -984,11 +976,7 @@ window.addEventListener('ContentStart', function ss_onContentStart() {
|
||||
context.drawWindow(window, 0, 0, width, height,
|
||||
'rgb(255,255,255)', flags);
|
||||
|
||||
// I can't use sendChromeEvent() here because it doesn't wrap
|
||||
// the blob in the detail object correctly. So I use __exposedProps__
|
||||
// instead to safely send the chrome detail object to content.
|
||||
shell.sendEvent(getContentWindow(), 'mozChromeEvent', {
|
||||
__exposedProps__: { type: 'r', file: 'r' },
|
||||
shell.sendChromeEvent({
|
||||
type: 'take-screenshot-success',
|
||||
file: canvas.mozGetAsFile('screenshot', 'image/png')
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user