OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 items.push(item); | 246 items.push(item); |
247 }, | 247 }, |
248 removeAll: function() | 248 removeAll: function() |
249 { | 249 { |
250 contextMenuItems.delete(this._page); | 250 contextMenuItems.delete(this._page); |
251 } | 251 } |
252 }; | 252 }; |
253 | 253 |
254 safari.application.addEventListener("contextmenu", function(event) | 254 safari.application.addEventListener("contextmenu", function(event) |
255 { | 255 { |
| 256 if (!event.userInfo) |
| 257 return; |
| 258 |
256 var pageId = event.userInfo.pageId; | 259 var pageId = event.userInfo.pageId; |
257 if (!pageId) | 260 if (!pageId) |
258 return; | 261 return; |
259 | 262 |
260 var page = pages[event.userInfo.pageId]; | 263 var page = pages[event.userInfo.pageId]; |
261 var items = contextMenuItems.get(page); | 264 var items = contextMenuItems.get(page); |
262 if (!items) | 265 if (!items) |
263 return; | 266 return; |
264 | 267 |
265 var context = event.userInfo.tagName; | 268 var context = event.userInfo.tagName; |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 page.activate(); | 672 page.activate(); |
670 if (callback) | 673 if (callback) |
671 callback(page); | 674 callback(page); |
672 return; | 675 return; |
673 } | 676 } |
674 } | 677 } |
675 | 678 |
676 ext.pages.open(optionsUrl, callback); | 679 ext.pages.open(optionsUrl, callback); |
677 }; | 680 }; |
678 })(); | 681 })(); |
OLD | NEW |