-
Notifications
You must be signed in to change notification settings - Fork 15k
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
webview: page-favicon-updated navigation event and getFavicon api #1438
Conversation
* `event` Event | ||
* `favicons` [String] | ||
|
||
Emitted when page receives favicon urls. |
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.
"urls" as far as I know, a page only has one favicon, which means only one wrong.
Was it introduced recently?
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.
You can specify icons with various sizes, this method will fetch all favicon urls present for a site. Maybe i should provide [size]
also as payload. I made the event name a bit confusing, will fix it and add api to get the current active favicon
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.
I just realized that I had a very confusing typo in there 😆
Added |
b342048
to
d8dbb7b
Compare
@@ -6,13 +6,17 @@ | |||
#define ATOM_BROWSER_API_ATOM_API_WEB_CONTENTS_H_ | |||
|
|||
#include <string> | |||
#include <vector> | |||
#include <set> |
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.
Don't need to include set
in header.
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.
cpplint
shouts otherwise :(
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.
Hmm this is strange, which line was it complaining? The atom_api_web_contents.cc
should still need to include set
though.
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.
Yeah its because of that, but i decided to have the standard headers in one place in api_web_contents.h
, should i move it ?
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.
Yeah it should be moved, api_web_contents.h
is also included by other files, adding a new include in api_web_contents.h
would slow down compilation speed for all those files. Even though it only slows down a little, it is still a good habit to keep minimal include
s.
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.
Ah cool, thanks!
I have no idea, I'm surprised that it happened. |
I don't think we should add And for the |
About You need |
One caveat with current |
Made the changes except for |
if (!entry) | ||
return gfx::Image(); | ||
auto favicon_status = entry->GetFavicon(); | ||
return favicon_status.image; |
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.
I think we can simply do return entry->GetFavicon().image
.
The purpose of
The |
We should probably move |
5ebf486
to
18b3dfa
Compare
Ah now its clear , thanks! have removed them, will try a new PR later. |
webview: page-favicon-updated navigation event and getFavicon api
Related #1378 and #1079 , not quite sure on how to achieve the various mutations for
page-url-set
. @zcbenz any clue on why the test forwill-navigate
gets called forspec/index.html
too ?Depends on electron/native-mate#1