Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/child/contextMenu.js

Issue 29331700: Issue 3223 - Implement context menu fallback for SeaMonkey Mail and Thunderbird (Closed)
Patch Set: Don`t send real event, minimal object will do Created Dec. 2, 2015, 12:20 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/ui.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 } 114 }
115 115
116 return items; 116 return items;
117 }; 117 };
118 118
119 let ContextMenuObserver = 119 let ContextMenuObserver =
120 { 120 {
121 observe: function(subject, topic, data) 121 observe: function(subject, topic, data)
122 { 122 {
123 if (topic == "content-contextmenu") 123 if (subject.wrappedJSObject)
124 { 124 subject = subject.wrappedJSObject;
125 if (subject.wrappedJSObject)
126 subject = subject.wrappedJSObject;
127 125
128 if (subject.addonInfo) 126 if (subject.addonInfo)
129 subject.addonInfo.adblockplus = getContextInfo(subject.event); 127 subject.addonInfo.adblockplus = getContextInfo(subject.event);
130 }
131 }, 128 },
132 QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObse rver]) 129 QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObse rver])
133 }; 130 };
134 131
135 let addObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "addObserver "); 132 let addObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "addObserver ");
136 addObserver.call(Services.obs, ContextMenuObserver, "content-contextmenu", true) ; 133 addObserver.call(Services.obs, ContextMenuObserver, "content-contextmenu", true) ;
134 addObserver.call(Services.obs, ContextMenuObserver, "AdblockPlus:content-context menu", true);
137 onShutdown.add(() => { 135 onShutdown.add(() => {
138 let removeObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "remove Observer"); 136 let removeObserver = Utils.getPropertyWithoutCompatShims(Services.obs, "remove Observer");
139 removeObserver.call(Services.obs, ContextMenuObserver, "content-contextmenu"); 137 removeObserver.call(Services.obs, ContextMenuObserver, "content-contextmenu");
138 removeObserver.call(Services.obs, ContextMenuObserver, "AdblockPlus:content-co ntextmenu");
140 }); 139 });
OLDNEW
« no previous file with comments | « no previous file | lib/ui.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld