mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1082450 - Fix quitter extension. r=gabor
This commit is contained in:
parent
a0a87ae128
commit
d8c553d744
@ -4,19 +4,14 @@
|
|||||||
|
|
||||||
var Ci = Components.interfaces;
|
var Ci = Components.interfaces;
|
||||||
var Cc = Components.classes;
|
var Cc = Components.classes;
|
||||||
|
var Cu = Components.utils;
|
||||||
|
|
||||||
function Quitter() {
|
function Quitter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Quitter.prototype = {
|
Quitter.prototype = {
|
||||||
toString: function() { return "[Quitter]"; },
|
toString: function() { return "[Quitter]"; },
|
||||||
quit: function() {
|
quit: function() { sendSyncMessage('Quitter.Quit', {}); }
|
||||||
sendSyncMessage('Quitter.Quit', {});
|
|
||||||
},
|
|
||||||
__exposedProps__: {
|
|
||||||
'toString': 'r',
|
|
||||||
'quit': 'r'
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is a frame script, so it may be running in a content process.
|
// This is a frame script, so it may be running in a content process.
|
||||||
@ -30,8 +25,12 @@ function QuitterManager() {
|
|||||||
|
|
||||||
QuitterManager.prototype = {
|
QuitterManager.prototype = {
|
||||||
handleEvent: function handleEvent(aEvent) {
|
handleEvent: function handleEvent(aEvent) {
|
||||||
|
var quitter = new Quitter(window);
|
||||||
var window = aEvent.target.defaultView;
|
var window = aEvent.target.defaultView;
|
||||||
window.wrappedJSObject.Quitter = new Quitter(window);
|
window.wrappedJSObject.Quitter = Cu.cloneInto({
|
||||||
|
toString: quitter.toString.bind(quitter),
|
||||||
|
quit: quitter.quit.bind(quitter)
|
||||||
|
}, window, {cloneFunctions: true});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user