Bookmark page code generator
Once upon a time, when the internet was just a little tacker, we were able to click a link to bookmark a page. It was pretty sweet! As time went by, the Browser Police took control and now they like your visitors to take control of the bookmarking themselves. This is all fine and dandy, but how do you prompt them to do this? You'll find visitors mostly move on without thinking to bookmark.The answer lies with still having a link - which will work with some browsers (mainly Internet Explorer variants) - and for those browsers that do not allow you to bookmark from a link, show instructions explaining how your visitors can do it themselves using CTRL-D.
The code used here is pretty sweet in that it is device-friendly, showing the relevant message for adding to bookmarks on devices.
The generated code utilises the 'Add to Home Screen' javascript, which will be included on your page (I don't take credit for writing the code for this functionality). The script is pulled from a CDN, which is recommended as it can be stored in your website visitors cache across different sites, and it also saves you from having to download/upload.
Frequently asked questions
Can a website really add a bookmark automatically?
No modern browser allows this any more (Chrome, Edge, Safari and current Firefox all removed the old JavaScript bookmarking APIs years ago, for security reasons - a site should never be able to silently modify a visitor's browser data). The two IE/old-Firefox code paths in this generator's output only apply to Internet Explorer and versions of Firefox that reached end-of-life long ago. For everyone else, the honest and most reliable approach is what this tool falls back to: a clear on-screen prompt telling visitors to press Ctrl+D (or Cmd+D on Mac).
What does the "Add to Home Screen" part actually do?
It's a related but different feature aimed at mobile visitors: rather than a browser bookmark, it prompts them to add an icon for your site to their phone's home screen, so it opens like an app. It's genuinely still useful today, which is why it's included alongside the Ctrl+D prompt.
Why does iPhone Chrome show different instructions?
Chrome on iOS can't trigger the "Add to Home Screen" prompt itself (Apple only allows that from Safari), so those visitors get a message telling them to open the page in Safari first. This is a real Apple platform restriction, not a limitation of this code.
Is it still worth using this generator if browsers block real bookmarking?
Yes - a clear, well-placed "press Ctrl+D to bookmark this page" prompt genuinely does increase how many visitors bookmark or return to a page, compared to no prompt at all. Just don't expect it to bookmark anything automatically; no legitimate code can do that any more.
