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
I couldnt get the above example to work. Anyway the answer to the original question 'its not working in CHROME and i don't get my error msg saying "not supported" either..' is due to the line
else if (window.external) { // IE
chrome actually passes this test and then obiously fails to add a bookmark. I changed this line to
else if(window.external && !window.chrome) // IE
and now you get the 'not supported' message. I actually removed this message and called the function hotKeys() to get a more meaningful alert. I had to make a few changes to get that to work
function showHotKeys()
{
var ua = navigator.userAgent.toLowerCase();
var str = '';
var isWebkit = (ua.indexOf('webkit') != - 1);
var isMac = (ua.indexOf('mac') != - 1);
if (ua.indexOf('konqueror') != - 1) {
str = 'CTRL + B'; // Konqueror
} else if (window.home || isWebkit || isMac) {
str = (isMac ? 'Command/Cmd' : 'CTRL') + ' + D'; // Netscape, Safari, iCab
}
return ((str) ? 'Press ' + str + ' to bookmark this page.' : str);
}