Last updated on March 2nd, 2022 at 07:42 am

Here is a simple script in javascript which shows how you can add a link in your website to make your visitors add the webpage to their Browsers Favorites.

We are using window.external.AddFavorite. 12 years ago when this tutorial was published all browsers supported this property but not anymore. Keeping this for just future reference.

Deprecated: As per Mozilla, this property is no longer recommended. Avoid using it, and update existing code if possible. More details

<script language="JavaScript">

function AddtoFav() {


<button onclick="AddtoFav();">
Click here to add main page to your favorites

If you run the above code you might most probably hit this error

Uncaught TypeError: window.external.AddFavorite is not a function

Leave a Reply

Your email address will not be published. Required fields are marked *