Lost password? | Help

[ advanced search ]

I would like to open linked images on a page directly in the background tab

Forums » Opera Community » Opera for desktop » Opera browser

Saturday, 6. October 2007, 22:21:39

I would like to open linked images on a page directly in the background tab

Hi,

It would be nice if I can open linked images on a page directly in the backgroud tab. Effectively I want to perform following sequence of steps in one action
1. First opening the url/page
2. Click something like "linked images" bookmarklet, which will open all the linked images in a new tab.

Any suggestions please?

Thanks

Saturday, 6. October 2007, 23:23:36

sgunhouse

Volunteer

avatar

Posts: 52984

Flag City, USA

Javascript can't direct tabs to open in the background though, also press F12 and change your setting to Open Pop-ups in Background.

Saturday, 6. October 2007, 23:26:01

AyushJ

avatar

Posts: 4754

Originally posted by sgunhouse:

Javascript can't direct tabs to open in the background though


Try that button :smile: If Shift+Middle-Click is set to Open in background tab then that button will open linked images in background tab.

Saturday, 6. October 2007, 23:39:22

shoust

Operaised

avatar

Posts: 3025

United Kingdom

The button say when used on this page opens a load of new tabs which many aren't images.

Saturday, 6. October 2007, 23:49:27

AyushJ

avatar

Posts: 4754

Originally posted by shoust:

The button say when used on this page opens a load of new tabs which many aren't images.


like ? It worked fine here (even logged me out p:)

Sunday, 7. October 2007, 15:29:35

First of all thanks for the efforts!!
Not really what I was looking for. But then it is my mistake as I wasn't clear enough about my expectations.
Ayush's if you please tweak your button a little I think it will fullfill my expectations.

1. I would like to open only links which are images. In current state the button opens other non-image links also e.g php
2. The button opens new tabs, what I am looking for is single new tab and all images in that tab
3. Can I get this functionality as a menuItem?

Thanks and Regards
:smile: :smile:

Monday, 8. October 2007, 03:52:52 (edited)

dude09

Flutterer

avatar

Posts: 4527

Try this: Create a new bookmark, then copy & paste this into the address slot for the new bookmark to create a bookmarklet.
(not mine, I got it from somewhere...)

Open all images in new page
javascript:(function(){s='';for (i=0;i<document.images.length;i++){s+='<img src="'+document.images[i].src+'"><br>'};if(s!=''){fg=window.open();fg.document.write('<center>'+s+'</center>');document.close();}else{alert('No images!');}})()


Open all Images to Links in new page
javascript:(function(){s='';for (i=0;i<document.images.length;i++){s+='<a href="'+document.images[i].src+'">'+document.images[i].src+'</a><br>'};if(s!=''){fg=window.open();fg.document.write(s);document.close();}else{alert('No images!');}})()


Open all Images to links & images in new page
javascript:(function(){function I(u){var t=u.split('.'),e=t[t.length-1].toLowerCase();return {gif:1,jpg:1,jpeg:1,png:1,mng:1}[e]}function hE(s){return s.replace(/&/g,'&').replace(/>/g,'>').replace(/</g,'<').replace(/"/g,'"');}var q,h,i,z=open().document;z.write('<p>Images linked to by '+hE(location.href)+':</p><hr>');for(i=0;q=document.links[i];++i){h=q.href;if(h&&I(h))z.write('<p>'+q.innerHTML+' ('+hE(h)+')<br><img src="'+hE(h)+'">');}z.close();})()


Thanks sgunhouse, I edited it...

Monday, 8. October 2007, 03:22:19

sgunhouse

Volunteer

avatar

Posts: 52984

Flag City, USA

You need to use a code tag, the forum is interpretting your array index of "i" as a formatting command for italics. Also not what he wanted. He said links to images. You'd need to open a blank tab, then inject all link URLs with an image suffix into the HTML of the tab. I'm sure it isn't too hard, but beyond my meager js talents.

Forums » Opera Community » Opera for desktop » Opera browser