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); |
})(); |