-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better vomnibar favicons (fix for domains and security issues) #1210
Conversation
I broke it here: 77e1ded
On reflection, this seems too dangerous: - Somebody excluded flash for a reason, and without knowing that reason, it seems dangerous. - Imagine a flash game with key bindings. Perhaps it uses ? to show the key bindings, and ESC to hide them again. With 2c7bebb, you can never hide the key bindings (I think). All in all, this just seems too risky.
There are some serious privacy considerations to be discussed around using the google service for these. I am uncomfortable with the idea of shipping (a matching subset of) the user's open tabs, history, bookmarks or custom search engines to a 3rd party service every time vomnibar is opened. Have you looked into using |
Yes, I looked at it. It wasn't very reliable, and (apparently) only deals up favicons which are actually in the cache. |
Okay. I can get behind this if we shield the user from this by default with an option in the background page, then. |
Not comment on the privacy implications, but could we request /favicon.ico
|
I tried this, @philc. Misses are common enough that I saw a fair few of them. For example, I have |
If /favicon.ico doesn't load, couldn't we fall back to |
@smblott-github, presumably those are for bookmarks, since redirects don't register in history? Since chrome caches icons for history and bookmarks to show in their UI, the ideal solution is to get the devs to expose them through the corresponding APIs. I'll go chromium issue hunting now. |
(I wrote a long response, then deleted it, because it became too complicated.) Bottom line: The Google URL in this PR is the best source of favicons I've seen. It's better than |
@smblott-github But @mrmr1993 is right, there is a huge privacy concern with sending all URLs directly to Google. There are a lot of people who would object to such automatic invasion of privacy. If we can't come up with a better solution, then I'd suggest at least make it an optional feature, which has to be enabled by the user. The option also needs a disclaimer that all URLs are sent to a Google server in case of activation |
There's a serious security issue associated with guessing favicons. Favicons are fetched in the security context of the host page. If that's Unfortunately, for some sites, including |
@smblott-github yes, #1139 should fix this. |
Conflicts: content_scripts/vomnibar.coffee
This works now:
It ended up being way more code than seems necessary (or, perhaps, is warranted) for this feature. All Every suggestion gets a favicon, although it may be a little globe (which here is "cached", but courtesy of Google). No requests are sent to Google (except those pertaining to Google itself). |
@@ -56,11 +56,26 @@ chrome.runtime.onConnect.addListener((port, name) -> | |||
port.onMessage.addListener(portHandlers[port.name]) | |||
) | |||
|
|||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) -> | |||
# With asynchronous responses to messages, we *must* call sendResponse (or we'll get a memory leak). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're worried about garbage collection because for some reason neither xhr.onerror
nor xhr.onload
might be called, I would recommend:
- using ports (via
chrome.runtime.connect
):- ports have an
onDisconnect
listener; we can use this to do any cleanup we need in the frontend. - even without our intervention, the garbage collector will cause
onDisconnect
to be called for the port. (I can expand on this if it would help.) - we don't have to have the
sendResponseWithTimeout
machinery.
- ports have an
- listening on
xhr.onreadystatechange
instead of seperately onxhr.onerror
andxhr.onload
, so we're less likely to have missed an event (and miss sending a response). - setting the timeout on
xhr
instead, withxhr.timeout = 121000
, and possibly binding thexhr.ontimeout
handler, if having a response within 2 minutes is still important.
This a biggish change, so I've been holding off from merging it. It seems to be working nicely for me. Has anybody else tried it out? (Or, as @philc might say, taken it for a spin?). I intend to merge this in the next few days. So, please let me know if there are problems. |
Reasons for merging:
Reasons against merging:
Possible improvements:
|
Would it be better to use the |
Closing this for now. I'll resubmit a simpler solution later. Conclusion:
We should either ditch favicons completely, or just rely on the best-effort favicons we get from |
Discussion moved to #1232. |
See #1239. |
Fixes #1208; or, at least, it much approves on the situation. And it does handle domains.
This fetches favicons from Google. Helpfully, Google serves up a nice little "world" icon for anything it doesn't know what else to do with. So we seem to get at least an icon for pretty much every site.
I don't think this is the final word on the matter.