Closed Bug 306180 Opened 19 years ago Closed 11 years ago

Feature request: Open all links within selected text in tabs

Categories

(Firefox :: Tabbed Browser, enhancement, P4)

enhancement

Tracking

()

RESOLVED WONTFIX
Future

People

(Reporter: lukka, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050813 Firefox/1.0.4 (Debian package 1.0.4-2sarge2)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050813 Firefox/1.0.4 (Debian package 1.0.4-2sarge2)

In the right-click menu of a link, there is the option "open in tab". How about,
when a region of text is selected, a menu item "open all links in tabs"?

Reproducible: Always
Can't find a duplicate, so confirming.
This might become a WONTFIX (cluttering UI with features).
Nice idea for an extension, though.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Related to Suite bug 9274?
(In reply to comment #1)
> This might become a WONTFIX (cluttering UI with features).

I would suggest to simply replace the 'Open Link in New Window' and 'Open Link
in New Tab' menuitems (when you right-click on a link that's part of a
selection) with 'Open N Links in New Windows' and 'Open N Links in New Tabs'
(where N is the number of links and only if there are 2 or more).
This way there is no clutter as no menuitems are added, it just slightly changes
the behaviour of an existing menuitem to one more likely to be what the user
wants, while retaining its meaning. In fact it would be more intuitive than the
current behaviour, and would mirror how you open multiple files in file managers.

(In reply to comment #2)

Yeah, this is bascially a simplified version of that for Firefox.

Hardware -> All
OS -> All
Version -> Trunk
OS: Linux → All
Hardware: PC → All
Version: unspecified → Trunk
Surely this is a Core issue now? I suspect bug 9274 should be set to Core as well, and this bug duped to that one.
Product: Firefox → Core
No, this isn't a core issue. Very few issues are "core: tabbed browser" bugs considering tabbrowser.xml is forked, and this isn't even a tabbed browser bug anyways.
Product: Core → Firefox
As a reference to those wanting this feature: Linky apparently does this.
http://gemal.dk/mozilla/linky.html
Worth thinking about, the context menu when text is selected is fairly sparse.
Priority: -- → P4
Target Milestone: --- → Future
Here's a short function that gets the selected links:

// Adapted from Jesse Ruderman's
// https://www.squarefree.com/bookmarklets/pagelinks.html#open_selected_links

// The key here is selection.containsNode
// https://developer.mozilla.org/en/DOM/Selection/containsNode
function getSelectedLinks(aFrame) {
  aFrame = this.getCurrentFrame(aFrame);

  var links = [];

  var selection = aFrame.getSelection();
  if (!selection || !selection.containsNode)
    return links;

  var docLinks = aFrame.document.links;
  for (var i = 0; i < docLinks.length; i++)
  {
    if (selection.containsNode(docLinks[i], true) && isSafeLink(docLinks[i].href))
    links = links.concat(docLinks[i]);
  }

  return links;
}

// This function is probably too simple
function isSafeLink(url) {
  if (url.substr(0,7) == 'mailto:') return false;
  if (url.substr(0,11) == 'javascript:') return false;
  return true;
}
This is an interesting feature request, and modifying the context menu text to show that multiple links can be opened is nice and concise, however the discoverability of this feature is going to be pretty low. Users who want this feature can use an add-on to achieve this.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.