How to create a button — add to home screen/bookmark (mobile/desktop)?

Hi all.
What are the practices to create a link/button on the website key that the site is added to bookmarks on the desktop? And how to make on mobile phone, the site were added not in bookmarks, and the main screen (otherwise, why do a bunch of favicons, for all types of devices =))?
July 9th 19 at 10:41
1 answer
July 9th 19 at 10:43
Solution
They are two completely different issues.
1. Pro desktop is so:
function bookmark(a) {
title=document.title;
url=document.location;
 try { 
 window.sidebar.addPanel(title, url, "");
 } catch (e) {
 if (window.opera && window.print || typeof(window.sidebar)=="object") { // Opera || Mozilla
a.rel="sidebar";
a.title=title;
a.url=url;
a.href=url;
 return true;
 } else if(document.all) { // Internet Explorer
 window.external.AddFavorite(url, title);
 return true;
 } else {
 alert('Press Ctrl+D (Cmd+D on MacOS) to add the page to favorites');
}
}
}

2. About to add to your home screen for Android: here
Application example: here
Please tell me a cross-browser script for desktop and mobile phones? - Jessica.Dicki commented on July 9th 19 at 10:46
I was doing for the desktop, on a mobile phone - not test. - Kyleigh_Hills commented on July 9th 19 at 10:49

Find more questions by tags FrontendHTMLJavaScriptjQuery