Closed Bug 483919 Opened 16 years ago Closed 9 years ago

Back/Forward/Reload context menu of the Web Panel were broken.

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: alice0775, Unassigned)

References

Details

(Keywords: regression)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4pre) Gecko/20090317 Firefox/3.5.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090317 Gecko/20080102 Minefield/3.6a1pre ID:20090317101214

Back/Forward/Reload context menus of the Web Panel were broken.
These menu items are visible, but did not work.
And Back/Forward menus state  is wrong.

Reproducible: Always

Steps to Reproduce:
1.Start Minefield with New Profile.
2.Load http://www.yahoo.com/ in the Sidebar (from bookmark which has checked "Load this bookmark in the sidebar")
3.Navigate (Input "Firefox" and Click "Web Search" button)
4.Right click (In order to carry out pop-up of the context menu)
Actual Results:  
Back/Foward/Reload menus did not work.
And Back/Forward menus state is wrong.

Expected Results:  
Back/Foward/Reload menuitems should work.
There should be a state of these menus surely. 

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4pre) Gecko/20090317 Shiretoko/3.5b4pre ID:20090317114959 is broken also.
These commands referred to from a context menu in web-panels.xul are not defined.

     <menuitem id="context-back"
                label="&backCmd.label;"
                accesskey="&backCmd.accesskey;"
                chromedir="&locale.dir;"
                command="Browser:BackOrBackDuplicate"
                onclick="checkForMiddleClick(this, event);"/>
      <menuitem id="context-forward"
                label="&forwardCmd.label;"
                accesskey="&forwardCmd.accesskey;"
                chromedir="&locale.dir;"
                command="Browser:ForwardOrForwardDuplicate"
                onclick="checkForMiddleClick(this, event);"/>
      <menuitem id="context-reload"
                label="&reloadCmd.label;"
                accesskey="&reloadCmd.accesskey;"
                command="Browser:ReloadOrDuplicate"
                onclick="checkForMiddleClick(this, event);"/>
Version: unspecified → Trunk
Should put the following code into web-panels.xul.

    <command id="Browser:BackOrBackDuplicate" oncommand="getPanelBrowser().webNavigation.goBack(event);" disabled="true">
      <observes element="Browser:Back" attribute="disabled"/>
    </command>

    <command id="Browser:ForwardOrForwardDuplicate" oncommand="getPanelBrowser().webNavigation.goForward(event);" disabled="true">
      <observes element="Browser:Forward" attribute="disabled"/>
    </command>

    <command id="Browser:ReloadOrDuplicate" oncommand="PanelBrowserReload(event)" disabled="true">
      <observes element="Browser:Reload" attribute="disabled"/>
    </command>
Re: Comment #2: Request for clarification:

Exactly where in web-panels.xul should the code go?

Should it go into the commandset:
  <commandset id="mainCommandset">
<command id="Browser:BackOrBackDuplicate"
oncommand="getPanelBrowser().webNavigation.goBack(event);" disabled="true">
      <observes element="Browser:Back" attribute="disabled"/>
    </command>

    <command id="Browser:ForwardOrForwardDuplicate"
oncommand="getPanelBrowser().webNavigation.goForward(event);" disabled="true">
      <observes element="Browser:Forward" attribute="disabled"/>
    </command>

    <command id="Browser:ReloadOrDuplicate"
oncommand="PanelBrowserReload(event)" disabled="true">
      <observes element="Browser:Reload" attribute="disabled"/>
    </command>
  </commandset>

Instead of the content which is there, currently:

  <commandset id="mainCommandset">
    <command id="Browser:Back"
             oncommand="getPanelBrowser().webNavigation.goBack();"
             disabled="true"/>
    <command id="Browser:Forward"
             oncommand="getPanelBrowser().webNavigation.goForward();"
             disabled="true"/>
    <command id="Browser:Stop" oncommand="PanelBrowserStop();"/>
    <command id="Browser:Reload" oncommand="PanelBrowserReload();"/>
  </commandset>
  
Sorry if this is a stupid question, but I'm a total n00b, but irritated enough about the inability to use the navigation items in the sidebar to want to try to do something about it. Anyways, if someone could take the time to try it and verify if it fixes the problem with these (Bug #483919 and Bug #501557) issues, or *at least* tell me whether my assumption of where to place the code is correct.
[See also: Bug #501557]
Added the code suggested in comment #2, but instead of replacing the existing code, I appended the code suggested in comment #2 it to the existing, like this (see comments):

  <commandset id="mainCommandset">
    <!-- Begin existing code -->
    <command id="Browser:Back"
             oncommand="getPanelBrowser().webNavigation.goBack();"
             disabled="true"/>
    <command id="Browser:Forward"
             oncommand="getPanelBrowser().webNavigation.goForward();"
             disabled="true"/>
    <command id="Browser:Stop" oncommand="PanelBrowserStop();"/>
    <command id="Browser:Reload" oncommand="PanelBrowserReload();"/>
    <!-- End existing code -->
    <!-- Begin comment #2 suggested code -->
    <command id="Browser:BackOrBackDuplicate"
             oncommand="getPanelBrowser().webNavigation.goBack(event);"
             disabled="true">
      <observes element="Browser:Back" attribute="disabled"/>
    </command>
    <command id="Browser:ForwardOrForwardDuplicate"
             oncommand="getPanelBrowser().webNavigation.goForward(event);"
             disabled="true">
      <observes element="Browser:Forward" attribute="disabled"/>
    </command>
    <command id="Browser:ReloadOrDuplicate"
             oncommand="PanelBrowserReload(event)"
             disabled="true">
      <observes element="Browser:Reload" attribute="disabled"/>
    </command>
    <!-- End comment #2 suggested code -->
  </commandset>

My initial impression after the restart of Firefox (3.5.3 BTW) is that this resolves the problem with the sidebar menu items Back/Forward/Reload/Stop not working as they should, though I have only verified Back and Reload at the point of writing this comment.

I kindly request that others with the possibility to do so try it and verify that the fix does what it should, and doesn't have any unforeseen effects. 

I am a total newbie with contributing to Firefox, so I don't have the said expertise to do all the necessary test.

PS: Remember to remove the comments I included above should this (potential) fix
make it to the next update.
Crossing my fingers, rubbing my rabbit's paw, looking for four-leaf clovers etc...
PS:
  Forgot location for fix:
   %Firefox%/chrome/browser.jar : content/browser/web-panels.xul
See attachment to bug #501557, Comment #11 (browser.jar with content/browser/web-panels.xul modified as described above).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Noted that with the update to FF 3.5.4, web-panels.xul reverted back to the old broken version and I had to modify web-panels.xul by hand again. So far, I haven't seen any problems except for the ones described in bug #501577, comment #14. What about including the fixed web-panels.xul in the next update, and maybe possibly merging this bug and #501577?
Bug #501557, nothing else.
Have used the above modifications for each version up until the current one (3.5.6.), manually editing the appropriate file because each update reverts to the broken web-panels.xul.
So far, the only error I've seen is the one described in #1, which is nothing more than a nuisance factor for me (not perfect, but I can live with it).
And frankly, I'm getting a little tired fixing this each time there's and update, so why not fix this and put it to rest?
Oopsie -- #1 in comment #15 of Bug 501557...
Regression range:

Works;
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b1pre) Gecko/20080901033305 Shiretoko/3.1b1pre ID:20080901033305

Broken:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b1pre) Gecko/20080902033133 Shiretoko/3.1b1pre ID:20080902033133

Push log:
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/f8554e4a7809

Candidate Regression:
Bug 440702  -  Link modifiers should use the command attribute instead of oncommand(and remove observes elements)
Blocks: 440702
Keywords: regression
klaas, what thoughts do you have on this potential regression from Bug 440702
(In reply to comment #12)
> klaas, what thoughts do you have on this potential regression from Bug 440702

Yeah, it's a regression from that bug. The web panel stuff was totally overlooked in that patch.

Apparently web-panels.xul is using its own commands instead of the ones from browser-sets.inc.

One solution is what Theo V. describes in comment #4.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.