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

Unified Diff: safari/content.js

Issue 5589897452716032: Implemented ext.contextMenus for Safari (Closed)
Patch Set: Corrected width and height of clickhide popup Created Jan. 7, 2014, 5:37 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« safari/background.js ('K') | « safari/background.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/content.js
===================================================================
--- a/safari/content.js
+++ b/safari/content.js
@@ -305,4 +305,15 @@
};
ext.onMessage = new MessageEventTarget(safari.self);
+
+ // Safari does not pass the element which the context menu is refering to
+ // so we need to add it to the event's user info.
+ document.addEventListener("contextmenu", function(event)
+ {
+ var element = event.srcElement;
+ safari.self.tab.setContextMenuEventUserInfo(event, {
+ srcUrl: ("src" in element) ? element.src : null,
+ tagName: element.tagName
Wladimir Palant 2014/01/17 15:36:55 Please use localName here.
Thomas Greiner 2014/01/18 10:32:05 Done.
+ });
+ }, false);
})();
« safari/background.js ('K') | « safari/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld