Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Liam Maclachlan
Liam Maclachlan
22,805 Points

Event listener for adding a bookmark

Hi all :)

I am trying to add a robust function to a website that will detect when a bookmark is added. The areas I will need to cover are:

1- combined KeyPress of CTRL + D

2- window.external. add to favourites listner for each type of browser that supports this, or a variant of.

3 - A button with an onclick event that adds to bookmarks with an error message fall back telling the user to do it manually (still tracking the click as a bookmark added)

Anyone have an idea on how to go about this or if there are any other options worth exploring?

There will be some serious differences on the mobile platforms, I would imagine.

I haven't started coding this yet. I don't want to waste my own time if this may not even be possible. If you do have any answers, please could you reference your sources to back up whether this is or is not possible. Doing so may lead to another avenue to solve this problem :)

1 Answer