favicon

How to set favicon.ico properly on vue.js webpack project?

此生再无相见时 提交于 2019-11-27 05:12:08
问题 I have created a vue webpack project using vue-cli . vue init webpack myproject And then ran the project under dev mode: npm run dev I got this error: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/favicon.ico So inside webpack, how to import the favicon.ico correctly? 回答1: Check out the Project Structure of webpack template: https://vuejs-templates.github.io/webpack/structure.html Note that there is a static folder, along with node

Get website's favicon with JS

痴心易碎 提交于 2019-11-27 05:01:42
问题 I am wondering if it is possible to get a website's favicon by an URL with JavaScript . For example I have an URL http://www.bbc.co.uk/ and I would like to get path to favicon described in <link rel="icon" .../> meta tag - http://www.bbc.co.uk/favicon.ico . I have many URLs so that should not load every page and search for link tag I think. Any ideas ? 回答1: You could use YQL for that http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D"http://bbc.co.uk/"and

Dynamic favicon using image manipulation similar to Gmail adding a count

℡╲_俬逩灬. 提交于 2019-11-27 04:59:16
问题 I tried to figure it out looking at the source code but I couldn't figure it out. I would like to know how to make a dynamic favicon with a count like Gmail does. Any idea on how to do this? 回答1: You can make an image with the canvas element, and then just replace the current favicon. Check out the following link for a good explanation on it. Reference Code is from the above reference. Markup <link id="favicon" rel="icon" type="image/png" href="image.png" /> JS (function () { var canvas =

vue3修改link标签默认icon无效问题

空扰寡人 提交于 2019-11-27 04:51:18
vue3修改link中标签默认icon,vue3初次使用的时候不好好阅读配置难免会遇到一些坑,本人在项目完结的时候打算把浏览器的导航小icon图标给替换了,可是并没有那么顺利,那么如何在vue3中替换默认的icon(favicon.ico)的导航栏图标呢: public的index.html有这么一句话,毫无疑问,一看给人的感觉就是在这个位置替换了 而且favicon.ico也是小图标,于是我直接替换,发现并不生效(特殊情况),把<%= BASE_BA %>直接改成./发现也不生效,怎么回事呢? 我们顺着问题进行查找,f12打开浏览器调试台查看结构中的icon link href指向 居然多了这么多图标地址,还是看官方配置吧,原来是忽略了pwa这个配置(该配置在vue.config.js中进行,这个地方将favicon.ico换成自己的图标地址即可): pwa:{ iconPaths:{ favicon32: 'favicon.ico', favicon16: 'favicon.ico', appleTouchIcon: 'favicon.ico', maskIcon: 'favicon.ico', msTileImage: 'favicon.ico' } },   配置完毕,项目重启,图标就换成我们自己的了 来源: https://www.cnblogs.com/mmykdbc

Unable to Change Favicon with Express.js

自闭症网瘾萝莉.ら 提交于 2019-11-27 04:18:25
问题 This is a really basic question, but I'm trying to change the favicon of my node.js/Express app with app.use(express.favicon(__dirname + '/public/images/favicon.ico')); and I'm still getting the default favicon. This is in my app.configure function, and yes, I've verified that there is a favicon.ico in the /public/images/favicon.ico .There's nothing about a favicon.ico in the console, either, which leads me to believe that this line of code is being ignored. Everything else in the function

Spring Boot: Overriding favicon

六眼飞鱼酱① 提交于 2019-11-27 04:17:14
问题 How can I override the favicon of Spring Boot? NOTE : Here is my another question that provides another solution which does not involve any coding: Spring Boot: Is it possible to use external application.properties files in arbitrary directories with a fat jar? It's for application.properties, but it can also be applied to the favicon. In fact, I'm using that method for favicon overriding now. If I implement a class that has @EnableWebMvc, WebMvcAutoConfiguration class of Spring Boot does not

How can I get a favicon to show up in my django app?

房东的猫 提交于 2019-11-27 04:11:21
问题 I just want to drop the favicon.ico in my staticfiles directory and then have it show up in my app. How can I accomplish this? I have placed the favicon.ico file in my staticfiles directory, but it doesn't show up and I see this in my log: 127.0.0.1 - - [21/Feb/2014 10:10:53] "GET /favicon.ico HTTP/1.1" 404 - If I go to http://localhost:8000/static/favicon.ico , I can see the favicon. 回答1: If you have a base or header template that's included everywhere why not include the favicon there with

HTML favicon won't show on google chrome

筅森魡賤 提交于 2019-11-27 03:55:14
I am making a HTML page that is unpublished . One of the things I wanted to do was add a favicon to appear next to the title. I'm using google chrome and I noticed that other websites have favicons that appear next to the tile in the browser, but the one I'm trying to display won't show up. The site in in a folder on my desktop named site. This is the code: <!DOCTYPE html> <html> <head> <title></title> <link rel="shortcut icon" href="/favicon.ico" /> </head> <body> </body> </html> Since you have a leading / in your href, you are referencing a file that will be in the root-folder. In case you

Will browsers request /favicon.ico or <link> first?

孤人 提交于 2019-11-27 03:32:55
问题 I want to set a favicon to be requested from a static file server instead of the main web server for performance optimization. If I specify a <link rel="shortcut icon" href="http://cdn.site.com/favicon.ico"> but also have a /favicon.ico in my site root as a fallback, which will browsers prefer? Will browsers (and which?) still look for /favicon.ico , making the move to a static file server useless? 回答1: I did the test suggested above. I placed a /favicon.ico in the root of a domain, and a

Add favicon to JSF project and reference it in <link>

倖福魔咒の 提交于 2019-11-27 00:43:45
问题 How do I add a favicon to a JSF project and reference it in <link> element? I tried as below: <h:head> <link rel="icon" type="image/x-icon" href="images/favicon.ico"/> ... </h:head> However, it didn't show any favicon. 回答1: A relative href is relative to the current request URI. Likely it resolved to an invalid URL. You need to prepend with the context path so that it becomes relative to the domain root. Also, the rel has better to be shortcut icon to get it to work in older browsers too. In