views:

4890

answers:

3

hi there,

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');
}
+2  A: 

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.

Christoph
yep me too.. thought it was a dumb idea but the client wants it.. but if it isn't possible I suppose i will have find something else :-)
mark smith
If this is only for an ill-informed client, then why care if it works in Chrome or not?
DA
the FF situation has slightly improved: thanks to UI changes, it's now possible to mark the bookmark as regular when adding it, but by default it will still be opened in the sidebar
Christoph
A: 

so is it working for ther browsers like mozilla

blog
A: 

You can always alert the client to press ctr+D. This is universal across all browsers. It's tacky, but just as useful to the client.

Arlo Carreon