Thursday May 12, 2011

Implementing custom bookmarking feature

        "if (window.sidebar) {" +         "netscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\";); \n" +
        "      var bmsvc =    Components.classes[\"@mozilla.org/browser/nav-bookmarks-service;1\"].getService(Components.interfaces.nsINavBookmarksService); \n" +
        "      var ios =    Components.classes[\"@mozilla.org/network/io-service;1\"].getService(Components.interfaces.nsIIOService); \n" +
        "      var uri = ios.newURI(url, null, null); \n" +
        "      var bookMarkId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder,uri, bmsvc.DEFAULT_INDEX, title);"; +
        "} else if (window.opera && window.print) {" +
        "var elem=document.createElement('a'); " +
        "elem.setAttribute('href',url); " +
        "elem.setAttribute('title',title); " +
        "elem.setAttribute('rel','sidebar'); " + "elem.click(); " +
        "} else if (window.safari) { " + "} else if (window.external) {" +
        "window.external.AddFavorite( url, title);" + "}";

About

Talk on ADF (Mail To: vijay.x.mohan@oracle.com)

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today