2

I need to provide functionality allowing the visitor to bookmark specific links. I saw the window.external.AddFavorite() call has been deprecated.

The other method I see is bookmarks.create(), but it's not compatible with Safari and Firefox for Android.

Is there a cross-browser solution to allow for a user links for bookmarking? The similar questions on Stack Overflow have old threads that reference the deprecated solution.

Therefore, I need a modern solution.

vintorg
  • 217
  • 4
  • 17
  • No, because that's from 10 years ago. – vintorg Oct 11 '20 at 00:09
  • Old questions do not cease to be valid duplicate targets. – pppery Oct 11 '20 at 01:37
  • They do when they're no longer valid. – vintorg Oct 11 '20 at 07:51
  • @vintorg if you believe that your question is not satisfactorily answered by any other question on SO, then please ask a new question and explain in that question that you have looked at other questions (provide links) and explain WHY those questions aren't the same as yours. – Olian04 Oct 11 '20 at 08:15
  • 2
    Nobody has answered. There's no need to ask a new question when the current question is clear. I specified the AddFavorite() call was deprecated, and I got a 10 year old link using that call. – vintorg Oct 11 '20 at 17:49
  • "_They do when they're no longer valid._" No, they don't. We mark questions as duplicate because we want to keep the answers to the same question in one place. See [this Help Center page](https://stackoverflow.com/help/duplicates). If there is a better solution, it should be added to that question, not in a separate one. That being said, I don't believe the accepted answer there is outdated. It only uses `AddFavorite` when it is available. Many browsers don't allow to add bookmarks from scripts anymore. – Ivar Oct 12 '20 at 10:15
  • @Ivar those "answers" are not valid duplicates. Your own comment is an argument *against* using those duplicates - there's no `AddFavorite` any more. Anything that proposes using it isn't a valid answer, it only causes confusing. And wastes the time of others that have a similar problem. There are other, far better duplicates – Panagiotis Kanavos Feb 28 '22 at 10:43
  • It's no longer possible to add favorites programmatically because malicious sites abused this functionality to add bookmarks without the user's consent. This is already explained in other questions like [How to create a bookmark this page button?](https://stackoverflow.com/questions/54759623/how-to-create-a-bookmark-this-page-button) and [AddFavorite JS doesn't work](https://stackoverflow.com/questions/22085812/addfavorite-js-doesnt-work-with-chrome) – Panagiotis Kanavos Feb 28 '22 at 10:46
  • [bookmarks.create](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks/create) is a *browser extension* API, not available to web site Javascript. Mobile applications, including browsers, use the platform's Share functionality to send links to each other or to the home page – Panagiotis Kanavos Feb 28 '22 at 10:53
  • There may be workarounds though. If the bookmark is used to quickly open eg a product page in a PWA, the web site could store the info to local storage instead. This is essentially an application bookmark instead of a browser bookmark. – Panagiotis Kanavos Feb 28 '22 at 10:56
  • @PanagiotisKanavos I don't agree that those are not valid duplicates. "_And wastes the time of others that have a similar problem_" - That is exactly what happens if we shatter all answers across countless posts. An up-to-date answer should be added to the linked posts. Either a new one or an existing one merged from another Q/A. – Ivar Feb 28 '22 at 11:03
  • @Ivar I was looking for an answer to this. My time was wasted due to the invalid "duplicates". There are good duplicates. I spent the time to find those good duplicates. This isn't about scattering answers at all, it's about misleading and inappropriate "duplicates". Never mind that those "duplicates" don't even mention the fully supported Bookmarks API, making them bad answers from the start - they answer only half the question, incorrectly – Panagiotis Kanavos Feb 28 '22 at 11:17
  • @PanagiotisKanavos Your time was wasted this time. Other people's time is wasted when they end up on the linked duplicate directly from Google. Both can be resolved by having a good answer on the linked question. Or alternatively by closing them as a duplicate of a Q/A that _does_ have a good answer. – Ivar Feb 28 '22 at 11:26
  • Yes, that's exactly *my* point. And the duplicates here are simply bad – Panagiotis Kanavos Feb 28 '22 at 11:27

0 Answers0