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

Side by Side Diff: safari/ext/background.js

Issue 6465209950535680: Issue 1594 - Handle missing userInfo when processing contextmenu events on Safari (Closed)
Patch Set: Created Nov. 22, 2014, 3:28 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 | no next file » | 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 <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
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
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 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld