-3

How to save a website shortcut on your desktop using java script ?

2 Answers2

2

Using JavaScript this is not possible, it is a security feature implemented by browsers. Spammy websites would abuse this feature.

Dylan Kilkenny
  • 325
  • 4
  • 13
  • 1
    [Source](http://stackoverflow.com/questions/13509736/javascript-create-desktop-link-programmatically), second comment. – user7393973 Feb 15 '17 at 11:14
  • It is actually not impossible, since browsers can use [`beforeinstallprompt`](https://developer.mozilla.org/en-US/docs/Web/API/Window/onbeforeinstallprompt) to create desktop shortcuts. – Anderson Green Mar 04 '22 at 23:10
0

I don't think it is possible : adding to desktop is an OS thing ; JS through browser is not allow to do that. I might be wrong but I'll be surprised.

You can invite the user to do so in a nice enthusiastic modal though!

hsolatges
  • 3
  • 6