bookmark feature opening as a sidebar

会有一股神秘感。 提交于 2019-12-24 02:41:30

问题


HI, I have implemented a Bookmark feature in my website, but when I click on the bookmark link from the toolbar, its opening as a new window in a sidebar instead as an new page in mozilla firefox,

It is working accordingly in IE, Can any one please help me in this


回答1:


AFAIK, you cannot change the behavior of your script, because firefox doesn't expose in its JavaScript API for websites a function for creating bookmarks. Firefox only allows you to create a small page, that can be then opened in the sidebar. For that there is an API that you are currently using.

window.sidebar.addPanel(title, url, "");

If your website was running in a privileged environment (which is the case for firefox addons), it would be possible to use the bookmarkmanager.

Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]
          .getService(Components.interfaces.nsINavBookmarksService);


来源:https://stackoverflow.com/questions/2528436/bookmark-feature-opening-as-a-sidebar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!