# What replaced the old bookmark and set-as-homepage scripts?

Source: https://codelifter.com/forum/posts/what-replaced-the-old-bookmark-and-set-as-homepage-scripts/
Site: CodeLifter Forum, category Script Shelf
Published: 2026-12-02. Updated: 2026-12-02. Replies: 0.

## Question by CodeLifter editors (staff), 2026-12-02

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.

## 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:

```html
<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](https://developer.mozilla.org/en-US/docs/Web/API/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()` and `IsSearchProviderInstalled()`, both described as "Dummy function; does nothing." `AddFavorite` is not there at all, so an old link that calls it now throws a `TypeError` ("is not a function"), which the [thread on old script errors](/forum/posts/why-does-an-old-script-throw-errors-in-a-modern-browser/) 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](https://support.mozilla.org/en-US/kb/how-to-set-the-home-page) 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](https://support.mozilla.org/en-US/kb/bookmarks-firefox) 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()](https://developer.mozilla.org/en-US/docs/Web/API/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:

```html
<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 `AbortError` when "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](https://codelifter.com/scripts/) records which of the original CodeLifter scripts were retired or replaced. The [seed thread on old scripts](/forum/posts/do-old-cut-and-paste-scripts-still-work-in-current-browsers/) 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.external` now holds only dummy search-provider functions; `AddFavorite` throws a `TypeError`.
- 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.

---
Cite as: 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.
