You need to be logged in to post in the forums. If you do not have an account, please sign up first.
[UserJS] Snap Links - Open multiple links by drawing a box around links
Snap Links allows users to easily open multiple links in new tabs by drawing a box around them.
- - The user selects the links by drawing a rectangle
- - Only the main links are selected by default
- - Requires only one click
- - There is visual aid to show which links are currently selected
![]()
Left click on an empty area (no image,text,link etc.) and drag to "draw" the rectangle. Hold down Shift key to select all links and Alt key if you want to move the rectangle. You can press ESC anytime to cancel.
SIZE]B]

BTW: It would be nice if the script had the ability to open everything in the background.
GT500.org Forums -- Blog -- TeamSpeak -- Several Critiques of Opera 10
[Security Wiki]
Main Page -- Keeping Your Computer Clean
[System Specs]
For those who either need to know, or are just curious.
[Computers and Security]
BleepingComputer -- What the Tech -- Geeks to Go! -- BestTechie -- Microsoft Security Essentials -- Sponsored Search Results Lead to Malware -- S!Ri.URZ Research Blog
Originally posted by GT500:
I had to hold down the left mouse button and the shift key while dragging the get the rectangle to show up
If you start dragging over text then script will not run (so that you can select text) but dragging from an empty part of page should work fine.
Originally posted by GT500:
It would be nice if the script had the ability to open everything in the background.
It should open the links in background. Make sure Preferences>Advanced>Content>Javascript options..>Allow raising of windows is checked
Originally posted by AyushJ:
If you start dragging over text then script will not run (so that you can select text) but dragging from an empty part of page should work fine.
It doesn't matter where I start dragging. In Kestrel, if I don't hold the left mouse button and the Shift key, then the script doesn't work.
Originally posted by AyushJ:
It should open the links in background. Make sure Preferences>Advanced>Content>Javascript options..>Allow raising of windows is checked
Having that option disabled cuts down on many annoyances. Also, it's disabled by default in Kestrel, so you'll have a lot of people with that problem.
Maybe there's another way to ensure that the new pages do not steal focus?
GT500.org Forums -- Blog -- TeamSpeak -- Several Critiques of Opera 10
[Security Wiki]
Main Page -- Keeping Your Computer Clean
[System Specs]
For those who either need to know, or are just curious.
[Computers and Security]
BleepingComputer -- What the Tech -- Geeks to Go! -- BestTechie -- Microsoft Security Essentials -- Sponsored Search Results Lead to Malware -- S!Ri.URZ Research Blog
Originally posted by GT500:
It doesn't matter where I start dragging. In Kestrel, if I don't hold the left mouse button and the Shift key, then the script doesn't work.
I'm using Kestrel and left button+drag works fine here.
Try dragging from the gray background image here on this page. Other UserJavascripts ?Can anyone else confirm that the script is working fine ?
Originally posted by GT500:
Maybe there's another way to ensure that the new pages do not steal focus?
OK. Redownload the script. Now the script follows your Middle-Click setting (Shift+Middle-Click)
Originally posted by AyushJ:
OK. Redownload the script. Now the script follows your Middle-Click setting (Shift+Middle-Click)
That's odd... Now click-and-drag is working like it's supposed to...
Perhaps you accidentally fixed the problem I was having? Or possibly saving a new copy of the script is what fixed it...
Originally posted by AyushJ:
Other UserJavascripts ?
I have the following UserJS scripts installed:
1. OSpell
2. Extra Download Links
3. Improve Opera's Weekly Blog by Fearphage
4. My Opera Community Quick Edit
5. Operapedia
6. Quick Reply Formatting Tools
7. Source Tree View
8. Textarea Resizer
The only one that I could think of that could have been interfering would be the Textarea Resizer, but it should only affect text areas...
GT500.org Forums -- Blog -- TeamSpeak -- Several Critiques of Opera 10
[Security Wiki]
Main Page -- Keeping Your Computer Clean
[System Specs]
For those who either need to know, or are just curious.
[Computers and Security]
BleepingComputer -- What the Tech -- Geeks to Go! -- BestTechie -- Microsoft Security Essentials -- Sponsored Search Results Lead to Malware -- S!Ri.URZ Research Blog
Originally posted by AyushJ:
Can anyone else confirm that the script is working fine ?
Script is working fine.

Originally posted by AyushJ:
OK. Redownload the script. Now the script follows your Middle-Click setting (Shift+Middle-Click)
This corrected script is working fine, too.

Opera 9.50 build 9542
Opera 9.23 Final
26. September 2007, 19:13:39 (edited)
But rectangle height can't be changed in www.xyhd.tv for example. Looks like some styles are forced by page.
EDIT: There might be a bigger Opera problem there.
CSS rule that is causing this problem is this one:
#sidebar {
float:right;
[...]
}
After this is applied, background disappears from most of this page (same in Fx and Safari so it may be just a bad coding) and it affects this script in a way I've said (maybe still an Opera bug).
Originally posted by GT500:
Perhaps you accidentally fixed the problem I was having?
I just changed the links opening code
Originally posted by d.i.z.:
But rectangle height can't be changed in www.xyhd.tv for example. Looks like some styles are forced by page.
Should be fixed now ( added !important on outRect element's position/size-styles)
P/S: you see, after I left-click once (hold), the click the middle-click, then the square will appeared with the first click spot "locked" & I can adjust the size of the squre without holding the left-button... it looks like a "feature" to me...
Originally posted by AyushJ:
Originally posted by d.i.z.:
But rectangle height can't be changed in www.xyhd.tv for example. Looks like some styles are forced by page.
Should be fixed now ( added !important on outRect element's position/size-styles)
Didn't help. Real reason is that reported offsetHeight of document.body is only ~141. This is height of top part of the page that has background. Same thing in Safari and Fx so we should not care about it.
It would be hard to move stuff without launching links by the way.
Try downloading again and disabling other user-javascripts and make sure you only have one snap-links script in userjs folder.
with a strange exceptions on these forum... Kestrel 9542 doesn't work, but works on 9.23.
http://forum.orbitdownloader.com/
http://forum.ie7pro.com/
(So, I unchecked it, & now it work perfectly)
But the weird thing is that I have Display > "Enable inline frames" checked on my.opera.com, & it still work on the Opera forum...
Anyway, thanks for the user scripts.
http://zajec.net/bug/overflow.and.absolute - click on scrollbar (dont hold button) or arrow and move mouse away
28. September 2007, 21:15:02 (edited)
29. September 2007, 14:37:57 (edited)
I'm missing something like ScrollIntoView for links lists which are longer than the viewport of the browser.
For example the links in blog sidebars.
That means, the browser window should scroll for better user interaction, to see where the dotted selection ends.
//EDIT: Sorry, this was a misunderstanding of usage.
Ah!
Alt or Shift are not used with mouse dragging the selection; the keys are used as "switches" after the selection.
I have a small little problem with this script. I use BlinkList for storing my favorite sites, and whenever i activate the "BlinkThisSite" link a small window is shown in the current page (it's actually a movable DIV). Now the problem is that when i try to move the div the snaplinks script activates too. Is there a way to not have snaplinks activate when i drag a DIV element ?
A possible solution would be for snaplinks not to work on simple drag, only when a key is pressed (for example CTRL) or there could be a button that we can put somewhere in the toolbar that would activate/deactivate snaplinks. Also, now i remember that the GoogleTranslate with Tooltip has an option to show a button in the lower left corner of the window, that button is used to activate/deactivate the script. Could something similar be done in snaplinks ?
P.S. i really like the script, I'd sooner give up on dragging DIV's that this script, but it would be really cool to have both functionalities
Originally posted by dude09:
Uhh... I don't understand this feature. Can you please provide some explaination?
Duplicate urls will be ignored. Simple

http://my.opera.com/xErath/blog/
selection.png
Other thing. I've stumbled on some page that defined it's own getSelection function which made this script unusable. I would suggest to cache some function references in script and also pass opera object to anonymous function to make script more bullet proof.
document.defaultView.getComputedStyle(...)
is equivalent to
window.getComputedStyle(...)
and therefore
getComputedStyle(...)
You can spare the extra bytes

I've seen the line of code copied everywhere.
You might want to catch events during their capturing phase, as scripts which prevent bubbling in pages will colide with your script.
http://my.opera.com/xErath/blog/
- Duplicate links are now not selected by default. Hold Ctrl key to select them.
Originally posted by albuemil:
Is there a way to not have snaplinks activate when i drag a DIV element ?
Hold down alt key before dragging.
Originally posted by albuemil:
A possible solution would be for snaplinks not to work on simple drag, only when a key is pressed
Set reqAltKey in script to 1 then the script will activate only when alt key is pressed.
Originally posted by dude09:
I don't understand this feature. Can you please provide some explaination?
Just download v1.4

Originally posted by d.i.z.:
when [show] link (see the image) is one of the focused links then no other links will get selected
The show link is bigger than other links that's why only the "show" link is selected when shift key is not pressed.
Originally posted by d.i.z.:
With dupLinks set to 0 or shift pressed, all links are selected.
Are you sure ?
Originally posted by d.i.z.:
cache some function references in script and also pass opera object to anonymous function to make script more bullet proof.
Originally posted by xErath:
You might want to catch events during their capturing phase, as scripts which prevent bubbling in pages will colide with your script.
Done in v1.4.

Originally posted by xErath:
document.defaultView.getComputedStyle(...) is equivalent to window.getComputedStyle(...)
If there is no differnce between defaultView and window then why the defaultView attribute ?

Originally posted by xErath:
I've seen the line of code copied everywhere.
Yeah , I copied that from the extension
9. October 2007, 18:34:49 (edited)
1. When I clicked on any text-box's scroll-bar, Snap-Links with activated by itself...
TRY THIS! Click on the scroll-bar! TRY THIS! Click on the scroll-bar! TRY THIS! Click on the scroll-bar! TRY THIS! Click on the scroll-bar! TRY THIS! Click on the scroll-bar! TRY THIS! Click on the scroll-bar! TRY THIS! Click on the scroll-bar! TRY THIS! Click on the scroll-bar! TRY THIS! Click on the scroll-bar!
2. When I do a Flip-forward, Snap-Link will also activated. (Happened if no page is able to forward to, but if the "Forward" function is available & moved to the next page, the Snap-Links effect will still remain in the 1st page when I retreat with "Back" function.)
P/S: I have remove all scripts except the Snap-Links for the test, but these 2 problems still occured...
Originally posted by dude09:
1. When I clicked on any text-box's scroll-bar, Snap-Links with activated by itself...
http://my.opera.com/community/forums/findpost.pl?id=2264007
but it should work fine now (redownload snap links)
Originally posted by dude09:
When I do a Flip-forward, Snap-Link will also activated.
I don't think it's possible to fix it.
Originally posted by AyushJ:
Originally posted by dude09:
When I do a Flip-forward, Snap-Link will also activated.
I don't think it's possible to fix it.
Partial solution would be to set up a unload listener. But won't help when navigating cached pages or when there is nothing to flipforward.
Originally posted by dude09:
Is it possible to display the number of links that will be opened inside the selection?
The number of links in selection is displayed in status bar (View>Toolbars>Status bar).
I have a few requests:
1. SAVE option
there seems to be no difference btwn Click & Drag over a link and SHIFT + Click & Drag. Therefore, why not have the SHIFT key SAVE the pages rather than just open them.
2. Open links in foreground option
opening links opens them in the background - how about an option to open them in foreground.
3. Open/Save sequence option
how about an option to open (or save) the pages in a certain sequence - either in the actual order as they appear on the page (default), or alphabetically (when links are more scattered on the page).
4. Context Menu activation
somtimes I click & drag over links inadvertently, and only later realize that I have a lot of pages open, unintended - how about having the context menu get activated upon click & drag over links so that we can choose from several desired functions, ie.:
Open Links in Foreground
Open Links in Background
Open Links in New Window
Bookmarks Links...
Save Links As...
Save Links to Download Folder
25. October 2007, 20:53:11 (edited)
So at least references to these two should be stored. This will fix quite a few sites.
Code:
var selectSingleNode = Node.prototype.selectSingleNode, selectNodes = Node.prototype.selectNodes;
Example usage
selectSingleNode.call( ev.target, 'ancestor-or-self::node()...');
I know that you know how to do it but maybe some other script writes don't.
why not have the SHIFT key SAVE the pages rather than just open them.
I don't think it possible to invoke download dialog from user script.
how about having the context menu get activated upon click & drag
Nice request. +1
Originally posted by skye11:
1. SAVE option
4. Context Menu activation
Not possible

Originally posted by skye11:
2. Open links in foreground option
Shift+Middle-click and select Open in new tab
Originally posted by skye11:
alphabetically (when links are more scattered on the page).
By URL or by title ?
Originally posted by d.i.z.:
So at least references to these two should be stored.
done and script now uses getBoundingClientRect in kestrel

Snap links - v1.4.8
26. October 2007, 22:08:54 (edited)
Originally posted by AyushJ:
Originally posted by skye11:
4. Context Menu activation
Not possible
Creating absolutly positioned element after making rectangle should work.
script now uses getBoundingClientRect in kestrel
I don't know if my tests are flawed or what, but it seems kinda broken: http://files.myopera.com/d.i.z./bugs/bounding-rectangle.html
It returns bounding rectangle of the div that is a child of the hovered one.
EDIT: Or rather it returns bounding box not counting padding and border. This is a bug I guess because IE and Fx don't do this.
27. October 2007, 03:15:57 (edited)
Originally posted by d.i.z.:
Creating absolutly positioned element after making rectangle should work.
I thought he wants the real context menu (with bookmark/save as.. options). The script can only allow you to open in new tab or in background (not much useful..)
Originally posted by d.i.z.:
Or rather it returns bounding box not counting padding and border
I didn't think it would not be possible to add a Menu or Save As... option - too bad

In regards to opening pages by some natural sequential order (ie. alphabetical, or by their placement on the page), I thought it may be helpful on pages containing say ebooks, which are broken up into many separate chapters, and which are alphabetically or numerically arranged (ie, 01, 02, 03...) or somehow positioned sequentially on the page. It would save you from having to jump around many open Tabs searching for the next page.
Perhaps an option could be included to "open alphabetically by":
1. Page Title
2. URL
btw, on another similar note,
is it possible to create a "file-joiner" script within Opera that can allow a user to select & join a number of links (ie separate ebook chapters) and save them as one combined file? I tried using a several utilities (ie. 'Simple File Joiner') but have gotten mixed results. I could post this request in the Wishlist Forum, but I doubt it would be of interest to the Opera devs.
Showing topic replies 1 - 50 of 243.