How can I had some contents from Chrome/Chromium browsers?
Posted
by
MIH1406
on Pro Webmasters
See other posts from Pro Webmasters
or by MIH1406
Published on 2012-11-10T06:09:41Z
Indexed on
2012/11/10
11:15 UTC
Read the original article
Hit count: 347
I need to put a "Bookmark us" in my website. But as I searched using Google all the results conclude that no way to do "Bookmark us" for Chrome/Chromium browsers.
So I want to either:
1- Hide the content from chrome/chromium browsers.
or at least,
2- Show a message if the user's browser is chrome/chromium after clicking that buttong.
Here is my "Bookmark Us" script:
/** Bookmark Us */
function bookmark_us(url, title){
if(window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all) // ie
window.external.AddFavorite(url, title);
} else {
}
/** Bookmark Us */
<a href="javascript:bookmark_us('URL','TITLE')">Bookmark Us!</a>
© Pro Webmasters or respective owner