简体   繁体   中英

How do I override the title of a bookmark for a web page?

When adding a bookmark or favorite the browser uses the TITLE tag of the page to automatically populate the title of the bookmark. However, my web pages use SEO-friendly titles which are not really user-friendly. Is there a method to override the title when the browser makes a bookmark?

I am aware that I can create a link on the page that calls javascript:

javascript:window.external.addFavorite("url","custom title");  

But is is possible to do something similar when a user uses the menu or hotkey to create a bookmark?

You're trying to solve the wrong problem.

However, my web pages use SEO-friendly titles which are not really user-friendly

This is what you need to fix. Your page titles should be user friendly.

To be honest, if you're doing it right SEO and User friendly titles should be synonymous... can you post some examples as to why you feel the need for them to be so different?

I can't see how that would be possible. The browser takes the Title loaded, which is the Title displayed on the top of the page. When saving a bookmark, it doesnt go through the code. It just adds the URL and takes the site Title.

You could check if the "bookmark"-pressing triggers a javascript event, though, i think it woudlnt be cross-browser :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM