Closed Bug 591635 Opened 15 years ago Closed 7 years ago

Middle click on "Paste and Go/Search" should open in a new tab

Categories

(Firefox :: Address Bar, enhancement)

x86
All
enhancement
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: imradyurrad, Unassigned)

References

Details

User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0b5pre) Gecko/20100827 Firefox/4.0b5pre Build Identifier: Mozilla/5.0 (Windows NT 6.1; rv:2.0b5pre) Gecko/20100827 Firefox/4.0b5pre One less step. Reproducible: Always
Depends on: 492544
We can do "Paste and Send Alt+Enter" for middle-click.
(In reply to comment #2) > We can do "Paste and Send Alt+Enter" for middle-click. What is "Paste and Send Alt+Enter" ? There is not such a menuitem.
(In reply to comment #3) > What is "Paste and Send Alt+Enter" ? > There is not such a menuitem. Do "Paste and Send Alt+Enter" when middle-click on "Paste and Go/Search".
(In reply to comment #4) > (In reply to comment #3) > > What is "Paste and Send Alt+Enter" ? > > There is not such a menuitem. > > Do "Paste and Send Alt+Enter" when middle-click on "Paste and Go/Search". Nothing happens.
I mean something like: goDoCommand('cmd_selectAll'); goDoCommand('cmd_paste'); var evt = document.createEvent('KeyboardEvent'); evt.initKeyEvent('keypress', true, true, null, false, false, false, false, 13, 0); document.popupNode.dispatchEvent(evt);
Depends on: 611590
Status: UNCONFIRMED → NEW
Ever confirmed: true
No longer depends on: 611590
Version: unspecified → Trunk
Solution (set oncommand as the following): goDoCommand('cmd_selectAll'); goDoCommand('cmd_paste'); window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils) .sendKeyEvent('keypress', KeyEvent.DOM_VK_RETURN, 0, event.button > 0 || event.ctrlKey ? Ci.nsIDOMNSEvent.ALT_MASK : 0);
userChrome.js snippet to fix this bug. (function bug591635() { let code = "\ goDoCommand('cmd_selectAll');\ goDoCommand('cmd_paste');\ window.QueryInterface(Ci.nsIInterfaceRequestor)\ .getInterface(Ci.nsIDOMWindowUtils)\ .sendKeyEvent('keypress',\ KeyEvent.DOM_VK_RETURN,\ 0,\ event.button == 1 || event.ctrlKey ? Ci.nsIDOMNSEvent.ALT_MASK : 0);\ "; let $$$ = function() document.getAnonymousElementByAttribute.apply(document, arguments); let inputBox = $$$(gURLBar, "anonid", "textbox-input-box"); let pasteAndGo = $$$(inputBox, "anonid", "paste-and-go"); pasteAndGo.setAttribute("oncommand", code); let searchbar = document.getElementById("searchbar"); if (searchbar) { let inputBox = $$$(searchbar.textbox, "anonid", "textbox-input-box"); let pasteAndSearch = $$$(inputBox, "anonid", "paste-and-search"); pasteAndSearch.setAttribute("oncommand", code); } })();
(In reply to comment #8) I installed userChromeJS from http://userchromejs.mozdev.org/ and created in my profile folder chrome/userChrome.js and pasted the contents above in the file, and it doesn't work.
This seems rather simple to fix, and it hasn't been marked WONTFIX, so I'm going to bump it to see if it reminds anyone. Normally I wouldn't.
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.