I haven't done much research on this yet but I just woke up and wanted to get this down before I forgot.
I need to make a "bookmark this page" sorta thing, buuuuut as we all know the functionality of this in Javascript is sketchy cross-browser wise. I did a quick google search and you can see this is no biggie in IE or Firefox, but what about the rest?
function addBookmark(title, url) {
if (window.sidebar) { // firefox
window.sidebar.addPanel(title, url,"");
} else if( document.all ) { //MSIE
window.external.AddFavorite( url, title);
} else {
alert("Sorry, your browser doesn't support this");
}
}
So what I was wondering is if there is a way for Javascript to simulate the user pushing a key. Something like this pseudocode:
function addBookmark(){
if(OS == Mac){
if(browser == Camino){
Keyboard.press(COMMAND + K);
} else {
Keyboard.press(COMMAND + D);
}
} else {
Keyboard.press(CONTROL + D);
}
}
Kinda like an interrupt for those of you familiar with assembly.
Maybe this doesn't make sense, like I said I just woke up. Any ideas let me know. Maybe I'm way off and there's a much simpler way.
Thanks
Steve