What replaced the old bookmark and set-as-homepage scripts?
Nothing replaced them directly. Browsers removed the ability for a page to add itself to bookmarks or make itself the home page, because sites abused it. Today the page can only help the person do it: show how to use the browser's bookmark star, offer a share button through the Web Share API, or make the site installable.
Cite
CodeLifter Forum, "What replaced the old bookmark and set-as-homepage scripts?", https://codelifter.com/forum/posts/what-replaced-the-old-bookmark-and-set-as-homepage-scripts/, accessed 2026-12-02.- CodeLifter editorsStaffStaff, CodeLifter ·
What did the old scripts do?
Two snippets were on thousands of personal sites around 2000. The "Add to favourites" link usually looked like this:
<a href="javascript:window.external.AddFavorite('http://example.com/', 'My Site')"> Add to Favorites</a>and the "Make this my homepage" link used an Internet Explorer behaviour attached to the link before calling a method on it. Both only worked in Internet Explorer, so the scripts were wrapped in browser checks, with a fallback message for Netscape and later Firefox users telling them to press a key combination themselves.
Why don't they work now?
Because the methods they called are gone. MDN's page on Window.external marks it deprecated and says it "was intended to contain functions related to adding external search providers to the browser. However, this is now deprecated, and the contained methods are now dummy functions that do nothing as per spec." The page lists only two methods,
AddSearchProvider()andIsSearchProviderInstalled(), both described as "Dummy function; does nothing."AddFavoriteis not there at all, so an old link that calls it now throws aTypeError("is not a function"), which the thread on old script errors explains how to read.The home page trick depended on an Internet Explorer-only feature, and no current browser offers pages anything like it. That is deliberate. Firefox's home page help article lists, under "Having problems?", what to do "If your home page was hijacked or automatically changed", and points to an article on toolbars that take over the home page. A setting that a web page could change with one click was a setting that unwanted software could change too.
What can a page do instead?
Old feature What to offer now Works where "Add to favourites" link A line telling people to use the browser's bookmark star Every browser "Add to favourites" link, on phones A share button using navigator.share()Browsers that support the Web Share API "Make this my homepage" Short instructions, or nothing Every browser Both, for frequent visitors An installable web app with a manifest Browsers that support installation Explain the browser's own feature. Firefox's bookmarks article says: "To bookmark a page, just click on the star in the address bar." It also notes that bookmarks are "called Favorites in Microsoft Edge", which matters if your audience still uses the old word. For a home page, the Firefox article describes two routes: drag the tab onto the Home button and confirm, or choose "Custom URLs" in the Home settings. A sentence linking to the relevant browser help page is more useful than a button that cannot work.
Offer sharing where it exists. MDN's page on navigator.share() says it "invokes the native sharing mechanism of the device", with targets that "might include the clipboard, contacts and email applications". Feature-detect it and keep a fallback:
<button type="button" id="keep">Save this page</button> <p id="keep-help" hidden>Use the star in your browser's address bar to bookmark this page.</p> <script> const keep = document.getElementById("keep"); const help = document.getElementById("keep-help"); keep.addEventListener("click", async () => { if (navigator.share) { try { await navigator.share({ title: document.title, url: location.href }); } catch (err) { if (err.name !== "AbortError") help.hidden = false; } } else { help.hidden = false; } }); </script>MDN's notes explain the details in that code. The method needs "transient activation": it "must be triggered off a UI event like a button click and cannot be launched at arbitrary points by a script." It is available "only in secure contexts (HTTPS)". It rejects with
AbortErrorwhen "The user canceled the share operation", which is not a failure worth reporting. And MDN labels the API "Limited availability" because it "does not work in some of the most widely-used browsers", so the fallback is not optional.Should you still have a button at all?
Often not. A button that only shows instructions adds a click. A plain sentence near the footer, or nothing, works as well, because people who bookmark sites already know how. The share button earns its place on pages people send to each other, such as articles and recipes. For a site people return to daily, an installable web app with a manifest is the closest modern equivalent of "make this my homepage", but it is a larger job than replacing a link.
The Script Shelf records which of the original CodeLifter scripts were retired or replaced. The seed thread on old scripts lists other patterns that stopped working for similar reasons.
Checked on 12 November 2026.
Short version
- Pages can no longer bookmark themselves or set themselves as the home page; the methods are gone or do nothing.
window.externalnow holds only dummy search-provider functions;AddFavoritethrows aTypeError.- Tell people about the bookmark star, or link to their browser's help page.
- On supporting browsers, a share button with
navigator.share()reaches the system share sheet. - Delete the old links rather than leaving a button that cannot work.
Write something first.
Give people something to work with: at least 30 words on what happened and what you tried.
That is too long. Keep it under 6,000 characters.
Write the question as the title, 15 to 140 characters, no links.
Pick a category.
Add a name (2 to 40 characters, no links).
That email address does not look right.
That was quick. Read the thread, then try again.
The form expired. Reload the page and post again.
Something went wrong with the form. Reload and try again.
Please complete the check and post again.
Limit reached for now. Try again later.
This thread is closed to new replies.
This thread no longer accepts replies.
Something went wrong with the form. Reload and try again.
Post a reply or question first (name and email), then this browser can vote, edit and accept answers.
You cannot vote on your own post.
Only the author (within 30 days) or the forum team can do that.
That email already has an account. Use your sign-in link instead.
New accounts are paused for the moment. Try again later.
That was already posted.