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

Unified Diff: include.postload.js

Issue 5589897452716032: Implemented ext.contextMenus for Safari (Closed)
Patch Set: Created Jan. 7, 2014, 11:57 a.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
« no previous file with comments | « chrome/background.js ('k') | lib/prefs.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -563,7 +563,7 @@
sendResponse({filters: clickHide_filters});
clickHideFiltersDialog.style.width = (msg.width + 5) + "px";
- clickHideFiltersDialog.style.height = (msg.height + 5) + "px";
+ clickHideFiltersDialog.style.height = (msg.height + 15) + "px";
Thomas Greiner 2014/01/07 12:13:11 This was necessary because Safari is otherwise sho
Sebastian Noack 2014/01/07 14:13:14 This is a hack. The problem here is that the code
Thomas Greiner 2014/01/07 15:01:39 Sounds like you addressed that already?! In that c
Sebastian Noack 2014/01/07 15:42:28 No I didn't. I just figured out what the problem i
Thomas Greiner 2014/01/07 16:15:51 I see your point but block.html is included as an
Sebastian Noack 2014/01/07 16:28:34 Yes, that is true. And that is why we send a messa
Thomas Greiner 2014/01/07 17:39:42 Sorry, I got a bit confused when you were talking
Sebastian Noack 2014/01/07 17:42:21 Sorry, I meant block.js.
clickHideFiltersDialog.style.visibility = "visible";
}
break;
@@ -589,4 +589,18 @@
break;
}
});
+
+ // 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.
+ if ("safari" in window)
+ {
+ document.addEventListener("contextmenu", function(event)
Sebastian Noack 2014/01/07 14:13:14 This should go in safari/ext/content.js
Thomas Greiner 2014/01/07 15:01:39 Done.
+ {
+ var element = event.srcElement;
+ safari.self.tab.setContextMenuEventUserInfo(event, {
+ srcUrl: ("src" in element) ? element.src : null,
+ tagName: element.tagName
+ });
+ }, false);
+ }
}
« no previous file with comments | « chrome/background.js ('k') | lib/prefs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld