Open Bug 181252 Opened 22 years ago Updated 3 months ago

middle-click or control left-click does not open new tab if clicked in search panel

Categories

(SeaMonkey :: Search, defect)

Sun
SunOS
defect
Not set
minor

Tracking

(Not tracked)

People

(Reporter: piessens, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827
Build Identifier: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827

In mozilla 1.1, I think it is very inconsequent that the middle-click button or
ctrl-click does not open a new tab. Instead it opens a sort of link composed of
what is in the X clipboard. 

Reproducible: Always

Steps to Reproduce:
1.In preference, tabbed browsing,  check use middle-click or ctrl-click 
2.just click on any link in the search panel
3.

Actual Results:  
A link was opened composed of what was in the X clipboard

Expected Results:  
open a new tab

These two patches can be apllied to fix the inconsistency

diff -c  search-panel.js ~/tmp/comm/content/communicator/search/search-panel.js 
*** search-panel.js     Wed May 29 07:06:41 2002
--- /users/micas/piessens/tmp/comm/content/communicator/search/search-panel.js 
Mon Nov 18 15:08:22 2002
***************
*** 804,810 ****
    return activeSearchFlag;
  }
   
! function sidebarOpenURL(listitem,tabflag)
  {
    var id = listitem.id;
    if (!id)
***************
*** 830,837 ****
  
    // mark result as visited
    listitem.setAttribute("visited", "true");
!   
!   loadURLInContent(id);
  }
  
  function OpenSearch(aSearchStr, engineURIs)
--- 830,851 ----
  
    // mark result as visited
    listitem.setAttribute("visited", "true");
!   if (tabflag.button == 1) {
!      tabflag.preventBubble();
!       if (!nsPreferences.getBoolPref("browser.tabs.opentabfor.middleclick"))
!                loadURLInNewWindow(target);
!       else loadURLInTab(target);}
!   else
!       if (tabflag.button == 0) 
!       {
!               if (tabflag.ctrlKey) {
!                       if
(nsPreferences.getBoolPref("browser.tabs.opentabfor.middleclick"))
!                               loadURLInTab(target);
!                       else
!                               loadURLInNewWindow(target);}
!               else 
!                       loadURLInContent(target);
!       }
  }
  
  function OpenSearch(aSearchStr, engineURIs)
***************
*** 1063,1068 ****
--- 1077,1097 ----
    window.openDialog("chrome://communicator/content/search/search-editor.xul",
"internetsearch:editor", "centerscreen,chrome,resizable");
  }
  
+ function loadURLInTab(url)
+ {
+   var navigatorWindow = getNavigatorWindow(true);
+   navigatorWindow.BrowserOpenTab();
+   navigatorWindow.loadURI(url);
+ }
+ 
+ function loadURLInNewWindow(url)
+ {
+   var navigatorWindow = getNavigatorWindow(true);
+ openNewWindowWith(url)  ;
+ //navigatorWindow.BrowserOpenWindow(url);
+   //navigatorWindow.loadURI(url);
+ }
+ 
  function loadURLInContent(url)
  {
    var navigatorWindow = getNavigatorWindow(true);

diff -c  search-panel.xul ~/tmp/comm/content/communicator/search/search-panel.xul 
*** search-panel.xul    Wed May 29 07:06:41 2002
--- /users/micas/piessens/tmp/comm/content/communicator/search/search-panel.xul
Mon Nov 18 15:09:14 2002
***************
*** 40,45 ****
--- 40,47 ----
    <script type="application/x-javascript"
src="chrome://global/content/strres.js"/>
    <script type="application/x-javascript"
src="chrome://communicator/content/search/search-panel.js"/>
    <script type="application/x-javascript"
src="chrome://communicator/content/search/shared.js"/>
+  <script type="application/x-javascript"
src="chrome://communicator/content/contentAreaUtils.js"/>
+  <script type="application/x-javascript"
src="chrome://communicator/content/utilityOverlay.js"/>
  
    <stringbundle id="searchBundle"
src="chrome://communicator/locale/search/search-panel.properties"/>
    <stringbundle id="regionalBundle"
src="chrome://communicator-region/locale/region.properties"/>
***************
*** 125,131 ****
                resource="http://home.netscape.com/NC-rdf#PageRank"
                resource2="http://home.netscape.com/NC-rdf#Name"
                flex="1" datasources="rdf:internetsearch"
!               onclick="if (event.button == 0 &amp;&amp; event.target.localName
== 'listitem') sidebarOpenURL(event.target);"
                ondraggesture="if (event.target.localName == 'listitem')
HandleResultDragGesture(event);"
                style="-moz-user-focus:ignore !important;">
  
--- 127,133 ----
                resource="http://home.netscape.com/NC-rdf#PageRank"
                resource2="http://home.netscape.com/NC-rdf#Name"
                flex="1" datasources="rdf:internetsearch"
!               onclick="if (event.target.localName == 'listitem')
{sidebarOpenURL(event.target,event);} "
                ondraggesture="if (event.target.localName == 'listitem')
HandleResultDragGesture(event);"
                style="-moz-user-focus:ignore !important;">
Attached patch javascript patchSplinter Review
Attached patch xul patchSplinter Review
can you make sure it works (and still needed) with latest nightly build too ?
http://ftp.mozilla.org/pub/mozilla/nightly/latest
Keywords: patch
Middle click on search sidebar links does load url from clipboard (linux trunk
cvs 2002-11-19; bug 171792). I saw some bugs about opening tabs from various
sidebar panel links, but no dup of this specifically, so marking new. wrt the
patches, I believe diff -u would be preferred
Status: UNCONFIRMED → NEW
Ever confirmed: true
Middleclick is still abosolutely inconsistent:

In bookmarks sidebar:
middle-clicking on a single link opens it in *current* tab.
middle-clicking on a folder      opens them all in new tabs. (that's fine :)

Search siedebar,
personal toolbar,
bookmark menu:
middle-clicking on a link does absolutely nothing.
isn't this OS=ALL?
Assignee: samir_bugzilla → search
QA Contact: claudius
Caliga, do you still see this problem?

Tim the reporter writes: ... I don't have access to a SUN-OS machine no longer so I wasn't able to test this. I am using firefox on GNU-linux and haven't seen such behaviour any longer. I assume it has been solved.
Product: Core → SeaMonkey
Attachment #9387570 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: