Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
42
rated 0 times [  46] [ 4]  / answers: 1 / hits: 54976  / 15 Years ago, sun, june 14, 2009, 12:00:00

Can anyone help, I am using the following for adding a bookmark to IE and Firefox but its not working in Chrome and I don't get my error msg saying not supported either..



Anybody know of a good script to support ALL browsers or at least to come back and tell me its not supported, I have access to jQuery - maybe there is some way to detect the browser



I am currently using this and it works for IE and Firefox but not chrome



if (window.sidebar) { // Mozilla Firefox
window.sidebar.addPanel(name, url, );
}
else if (window.external) { // IE
window.external.AddFavorite(url, name);
}
else if (window.opera && window.print) {
window.external.AddFavorite(url, name);
}
else {
alert('not supported');
}

More From » firefox

 Answers
18

Sorry, but there's no cross-browser way to do this. Your FF example is broken as well: It won't create a regular bookmark, but a bookmark set to be opened in the sidebar. You'd have to use the bookmark-service to create an actual bookmark, but this'll fail due to security restrictions.


[#99319] Wednesday, June 10, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
michaelashelbieh

Total Points: 303
Total Questions: 139
Total Answers: 97

Location: Suriname
Member since Sun, Oct 17, 2021
3 Years ago
michaelashelbieh questions
Sat, Nov 13, 21, 00:00, 3 Years ago
Fri, Sep 17, 21, 00:00, 3 Years ago
Tue, Sep 14, 21, 00:00, 3 Years ago
Mon, Aug 31, 20, 00:00, 4 Years ago
;