Skip to content
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

Add favicon for qute:// pages #3755

Open
saro opened this issue Mar 22, 2018 · 7 comments
Open

Add favicon for qute:// pages #3755

saro opened this issue Mar 22, 2018 · 7 comments
Labels
component: ui Issues related to the user interface. priority: 2 - low Issues which are currently not very important.

Comments

@saro
Copy link

saro commented Mar 22, 2018

Personally I rely on favicon to identify the tabs in the vertical bar.
It would be very nice to have at least one icon to identify all the qute:// pages.

@qutebrowser-bot qutebrowser-bot added the component: ui Issues related to the user interface. label Mar 22, 2018
@The-Compiler The-Compiler added the priority: 2 - low Issues which are currently not very important. label Mar 22, 2018
@ghost
Copy link

ghost commented Apr 2, 2018

Hi, I'd love to work on this issue!

@jgkamat
Copy link
Member

jgkamat commented Apr 3, 2018

Hi @juliandorville! I would like to see this done too, but I personally don't know where to start with this (I'm not sure if it's possible on qtwebengine).

I took a quick look at qutescheme and webenginequtescheme, but I wasn't able to find any place (or api) where we can specify a favicon. From the api, it looks like we provide some html and that shows up in the page when we hit that URL. Because it's a bit unclear, this might not be a good place for a first contribution, unless I'm missing something myself...

We could do something hacky like detecting if we are in qute pages and forcibly overriding the favicon to the qb logo, but that seems unideal to me. Maybe @The-Compiler has a better idea of how to tackle this.

@toofar
Copy link
Member

toofar commented Apr 3, 2018

I could be completely off base but I would suggest adding an icon handler in qutebrowser/browser/qutescheme.py to return one of the things in icons/ and then adding a link rel tag to qutebrowser/html/base.html. You would have to check at least

  • where the icons are installed to, if at all, so the qutescheme handler could find them
  • that all the qutescheme pages eventually inherited from base.html

@ghost
Copy link

ghost commented Apr 3, 2018

Yes, @toofar , that’s pretty much what I had in mind, too. But maybe we’re missing something?

@The-Compiler
Copy link
Member

Hmm, I thought a favicon.ico would be requested even if the HTML doesn't have a <link rel="icon" ...> tag? Because I don't think that happens currently. If it works to include such a tag, I agree that'd be the simplest solution.

@JimenezJC
Copy link

Hello, I've been working on this issue and seem to have run into a block. I've added an image handler to call the icon, and calling the icon using qute:// loads the image in the browser, and the image seems to be called whenever i use img src however, when calling it using the <link rel = "icon' .. > tag the image does NOT load.

I'm not entirely sure why that is since my handler manages to call the icon just fine, interestingly enough when i use <link rel="shortcut icon" type ="image/png" href="https://qutebrowser.org/media/favicon.png" /> the favicon does work. This is a possible solution but i'm not sure if is the best one?

@toofar
Copy link
Member

toofar commented Apr 11, 2018

When I tried <link rel="icon" type="image/png" href="{url}"/> with the following urls, results from the network tab of the web inspector:

favicon url request url
/favicon qute://settings/favicon
favicon qute://settings/favicon
//favicon qute://favicon/
qute://favicon qute://favicon

So it looks like using qute://favicon should work. I don't see anything in a web search about link rel always being relative even when prefixed by '/' so it may be another instance of #739
I did not see a request for favicon.ico in the absence of a link element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ui Issues related to the user interface. priority: 2 - low Issues which are currently not very important.
Projects
None yet
Development

No branches or pull requests

6 participants