JavaScript sidebar.addpanel should have similar behaviour as adding bookmark manually

RESOLVED DUPLICATE of bug 214530

Status

()

RESOLVED DUPLICATE of bug 214530
14 years ago
12 years ago

People

(Reporter: f.n.cristovao, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.7.10) Gecko/20050717 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.7.10) Gecko/20050717 Firefox/1.0.6

I think this will happen on any site, but I will point to this specific example:
in the top of the page at http://www.chipsite.pt there is a "Favoritos" icon
link that tries and succeeds to add a new bookmark; the problem is that it
defaults to "Load in sidebar" and the dialog box that allows to choose the
bookmark folder does not show the checkbox to control the preference. If I
manually add a bookmark to the same page, it defaults "not to load in sidebar".

I´m not sure if it is a bug or a feture, but I couldn't find any documentation
on it and, to my preference the addPanel method should behave like the manual
procedure, or else have some specific parameter to control this. I want the
bookmarks to load in the main window, not the sidebar, without having to go on
each bookmark properties and uncheck the option, after adding them.

Reproducible: Always

Steps to Reproduce:
1.click the "Favoritos" icon link on the top of the page http://www.chipsite.pt
2.click OK on the dialog box (accepting to store the bookmark)
3.open the bookmarks side panel
4.click on the bookmark you just added
Actual Results:  
The bookmarked page loads on sidebar instead of main browser window.
You can open the bookmarks side panel again and verify the bookmark properties -
it's checked to load on the sidebar


Expected Results:  
the window.sidebar.addPanel javascript method should have created a bookmark
with the option "load in sidebar" off by default (just like its manual counterpart).
Or at least there should be a checkbox to control this on the dialog box shown
to the user.

Comment 1

14 years ago
See also bug 66248, "[RFE] Ability for page javascript to add bookmark" (WONTFIX).
Summary: Javascript sidebar.addpanel shoul have similar behaviour as add bookmark manually → JavaScript sidebar.addpanel should have similar behaviour as adding bookmark manually

Comment 2

12 years ago
Just encountered this bug in Firefox 2.0.0.2 on Win XP and Mac OSX (Tiger).

Problem is that a bookmark created in the following way:

function CreateBookmarkLink(title, url) {
        if(title == null) { title = "Title"; }
        if(url == null) { url = "http://www.test.com/"; }

        if (window.sidebar) {
                // Mozilla Firefox Bookmark
                window.sidebar.addPanel(title, url, "");
        } else if( window.external ) {
                // IE Favorite
                window.external.AddFavorite( url, title);
        } else if(window.opera && window.print) {
                // Opera Hotlist
                var elem = document.createElement('a');
                elem.setAttribute('href',url);
                elem.setAttribute('title',title);
                elem.setAttribute('rel','sidebar');
                elem.click();
        }
}

results in a good bookmark. Problem is that the 'load this bookmark in the
sidebar' checkbox is checked standard. So if people click on a bookmark created
in the above manner, the bookmarked page opens in the sidebar.

My advice would be to uncheck the checkbox on creating a bookmark via
Javascript, so that pages can be added to the favorites on a normal way. And
people who still want to use the sidebar can still check the checkbox.

Remember that this functionality already works this way when people click
ctrl+d! So how hard can it be to make it the same for Javascript bookmarks?
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 214530
You need to log in before you can comment on or make changes to this bug.