Bookmark page with Javascript

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Locked
SergeGardien
Posts: 58
Joined: November 21st, 2013, 4:22 pm

Bookmark page with Javascript

Post by SergeGardien »

Hi, I'm looking to write a Javascript function to bookmark a page in Firefox (v38.0.1).
I've searched around on the web and this forum and I've found the following one http://buffernow.com/create-bookmark-link-using-javascript/ but actually the "addPanel" function has been deprecated a long time ago (https://developer.mozilla.org/en-US/Firefox/Releases/23/Site_compatibility#DOM) and in Scratchpad I get the exception "Exception: TypeError: window.sidebar.addPanel is not a function".
Moreover the bookmark created was opening (in old FF versions) in the sidebar and not in the full window.

Is there a way to make it work with another function or is this a no solution problem?

I wish many thanks to everybody will be so kind to help me out with this.

SergeGardien
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Bookmark page with Javascript

Post by trolly »

To my knowledge there is no solution. Access to chrome (the UI) is strictly prohibited and only possible for addons not pages.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
johnmacd
Posts: 34
Joined: June 13th, 2013, 4:27 am

Re: Bookmark page with Javascript

Post by johnmacd »

Try this function:
function add_bookmrk(url,page_title) {
alert(' !!! ');
javascript:function add_bookmark(url,page_title){location.href=url}CreateBookmarkLink();void(0);
alert(' ??? ');
}
WordPress Developer Miami providing best WordPress Websites for small businesses.
Locked