google image search "remove frame" issue
Posted by: Arrow
Date: October 26, 2008 01:36AM

when I use k-meleon for image search and click on a thumbnail result the page it takes me to is in a frame with a "remove frame" option up top.

However when I use TheWord browser I get the resultant page directly without the frame

how do I do this in k-m ?



Edited 1 time(s). Last edit at 10/26/2008 01:37AM by Arrow.

Re: google image search "remove frame" issue
Posted by: Arrow
Date: October 27, 2008 01:34AM

Typo: should read "TheWorld browser" above.

I see a couple of firefox extensions that can partially do it.
"customize google" and "google images re-linker"

however rather than direct the google image thumbnails to the websites minus the frame - they link directly to the single image only, which isn't what I am after.



Edited 1 time(s). Last edit at 10/27/2008 01:36AM by Arrow.

Re: google image search "remove frame" issue
Posted by: JamesD
Date: October 27, 2008 02:01AM

If you want the picture in context then highlight the web site under the picture, right-click and choose "Open as URL".

Re: google image search "remove frame" issue
Posted by: Arrow
Date: October 27, 2008 02:26AM

Thanks for pointing out that option.

I would prefer a simple click tho'


I've just twigged that it is actually a Maxthon plugin "remove link trackers that I have installed in TheWorld Browser which is directing the image click straight to the frameless page.


Though as k-m can already do it as you described above, how can it be made permanently active in k-m as default on left click?

Re: google image search "remove frame" issue
Posted by: Fred
Date: October 27, 2008 07:25AM

There could possibly a macro be written, but I do not know if there
is a placeholder for a string after &imgrefurl until the end of the URL,
instead of the asterisk * , to substitute, which does not work here in
this trial :
 
Google_image_direct{
$_image-google="";
$_image-google=gsub("http://images.google.com/imgres?imgurl=","",$LinkURL);
$_image-google=gsub("&imgrefurl*","",$_image-google);
opennew($_image-google);
}

(A part of the code appears as a link).
Maybe somebody knows if this is possible in this macro language.
This would lead to the original image directly.

Fred

Re: google image search "remove frame" issue
Posted by: desga2
Date: October 27, 2008 12:02PM

Google Images syntax:

- Google URL constant:
http://images.google.es/imgres?
- Image URL:
imgurl=http://
- Page URL:
&imgrefurl=http://

K-Meleon in Spanish



Edited 1 time(s). Last edit at 10/27/2008 07:53PM by desga2.

Re: google image search "remove frame" issue
Posted by: Fred
Date: October 27, 2008 03:55PM

Yes, I know, but how can I remove &imgrefurl=http:// and also
with it the string after that, which is always different.
Could there be a place-holder for the part after :// which I
thought could be an asterisk * , but this does not work ?

(the variable $_image-google should also be $_image_google .)

I want the original .jpg address to send only at the end.

Fred

Re: google image search "remove frame" issue
Posted by: JujuLand
Date: October 27, 2008 06:24PM

@Fred,

if the string is at the end :

Google_image_direct{
$_image-google="";
$_image-google=gsub("[images.google.com]);
$_furl=index("&imgrefurl",$_image-google);
$_image-google=substr($_image-google,1,$_furl);
#alert($_image-google,"Is-it ok?");
opennew($_image-google);
}

uncomment alert to adapt pointers 1 and $_furl, perhaps 0 and $_furl-1

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Re: google image search "remove frame" issue
Posted by: Arrow
Date: October 27, 2008 11:26PM

Thanks for looking into it.

I also remembered that a jesse ruderman bookmarklet "Remove Redirects" also does the same thing,
https://www.squarefree.com/bookmarklets/pagelinks.html

but it is not quite so convenient because it's necessary to click on the bookmarklet first - then any google image thumbnail on the active page will open to the frameless website

Here's a copy

Quote

[InternetShortcut]
URL=javascriptsad smileyfunction(){var k,x,t,i,j,p; for(k=0;x=document.links[k];k++){t=x.href.replace(/[%]3A/ig,':').replace(/[%]2f/ig,'/');i=t.lastIndexOf('http');if(i>0){ t=t.substring(i); j=t.indexOf('&'); if(j>0)t=t.substring(0,j); p=/https?\:\/\/[^\s]*[^.,;'%22>\s\)\]]/.exec(unescape(t)); if(p) x.href=p[0]; } else if (x.onmouseover&&x.onmouseout){x.onmouseover(); if (window.status && window.status.indexOf('://')!=-1)x.href=window.status; x.onmouseout(); } x.onmouseover=null; x.onmouseout=null; }})();

Quote

Changes redirecting links to go directly to the "real" target.

This bookmarklet uses two methods to determine the "real" target of a link.

If the link URL contains another URL, as in h**p://example.net/, the link becomes a link to h**p://example.net/.
If the link has a mouseover effect, and the mouseover effect puts something in the status bar that looks like a full URL, the link gets that URL.
Based on a submission by Michael Roller and a suggestion from Guido Tonini.



Edited 1 time(s). Last edit at 10/27/2008 11:29PM by Arrow.

Re: google image search "remove frame" issue
Posted by: Fred
Date: October 28, 2008 12:54AM

I have remembered at last, that a ? after .jpg will
ignore a following string, if there is no action
to do, corresponding to the string, and the address
ending with .jpg will be executed. So the macro in the .kmm
form would be :


# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Google Image Direct ----------------------------
#
# Dependencies        : main.kmm
# Resources        : -
# Preferences        : -
#
# ----------------------------------------------------------------------

Google_image_direct{
$_image_google="";
$_image_google=gsub("http://images.google.com/imgres?imgurl=","",$LinkURL);
$_image_google=gsub("&imgrefurl=http://","?",$_image_google); 
opennew($_image_google);
}

# ----- PRIVATE

Google_image_direct_BuildMenu{
# Image context menu
$__gim=_("Google_image_direct");
setmenu(ImageOpenExternal,macro,$__gim,Google_image_direct);
}

$OnInit=$OnInit."Google_image_direct_BuildMenu;";

# -----------------------------------------------------------------------
$macroModules=$macroModules."Google_image_direct;";

It is difficult to write an URL inside the code in
this forum.
Where the link: images.google.com appears as [images.google.com]
you have to replace [images.google.com] with the content
of the link, as it appears in the status bar, when the mouse
points to the link. If you copy and paste, the " sign is
pasted as %22 . Replace the %22's with " .
Save the macro as Google_image_direct.kmm to the folder
macros inside the K-Meleon main folder.

Right click the Google search image and click on
Google_image_direct in the submenu Image, to go directly
to the original image.

I hope that it will work ok

Fred

Re: google image search "remove frame" issue
Posted by: disrupted
Date: October 28, 2008 04:01PM

you can also try this search eninge:
http://cgi.search.biglobe.ne.jp

it's powered by google and yields almost the same results for images but opens sans frames

to add it in k-meleon

open references>finding websites> search engines tab> add entry

for url: http://cgi.search.biglobe.ne.jp/cgi-bin/pict/search?q=
caption: Images sans frames

after adding it, click on 'web search' tab> add entry and select 'images sans frames' from the drop down gorgeous menu

comparison:


Re: google image search "remove frame" issue
Posted by: Fred
Date: October 29, 2008 02:57AM

Very good if you want to see the other pictures
of the website too, while my macro leads to
the selected picture only.

Fred

Re: google image search "remove frame" issue
Posted by: Arrow
Date: October 29, 2008 04:47AM

Terrific - Thank you very much for your help everyone

Re: google image search "remove frame" issue
Posted by: desga2
Date: October 29, 2008 01:40PM

This is a most sophisticated version Fred's macro.
Two new context menu options for Google image links in:
Image -> View Only GImage
Image -> View Page GImage

Save this code in a filed named "Gimage.kmm" (for example):

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Google Image Extension ---------------------------------------------------------------
#
# Dependencies : main.kmm
# Resources : -
# Preferences : -
#
# -------------------------------------------------------------------------------------------------

# Google Images syntax:

# Fred's trick:
# $_GImg_URL=gsub("http://images.google.com/imgres?imgurl=","",$LinkURL);
# $_GImg_URL=gsub("&imgrefurl=http://","?",$_GImg_URL);

# - Google URL constant:
#$_GoogleImage="http://images.google.com/imgres?";;
# - Image URL:
#$_GImageURL="imgurl=http://";
# - Page URL:
#$_GPageImage="imgrefurl=http://";

# URL replacements:
# %3F="?"
$_GI_quest="%3F";
# %3D="="
$_GI_equal="%3D";
# %26="&"
$_GI_amp="%26";
# %22="\""
$_GI_quote="%22";

Gimage{
# From first = to first &
$_position1=index($LinkURL, "=")+1;
$_position2=index($LinkURL, "&");
$_GImg_URL=substr($LinkURL, $_position1, ($_position2-$_position1));
$OpenURL=$_GImg_URL; $OpenURL==""?0:&OpenURL_InNew;
}

G_PageImage{
# From second = to second &
# URL replacements can be needed

$_GImg_TMP=sub("=","",$LinkURL);
$_position1=index($_GImg_TMP, "=")+1;
$_GImg_TMP=substr($LinkURL, 1, $_position1);
$_GImg_Page=gsub($_GImg_TMP,"",$LinkURL);
$_position2=index($_GImg_Page, "&");
$_GImg_URL=substr($_GImg_Page, 1, $_position2-1);
$_GImg_URL=gsub($_GI_quest,"?",$_GImg_URL);
$_GImg_URL=gsub($_GI_equal,"=",$_GImg_URL);
$_GImg_URL=gsub($_GI_amp,"&",$_GImg_URL);
$_GImg_URL=gsub($_GI_quote,"\"",$_GImg_URL);
$OpenURL=$_GImg_URL; $OpenURL==""?0:&OpenURL_InNew;
}

# ----- PRIVATE

_Gimage_BuildMenu{
setmenu(ImageOpenExternal,macro,_("View Only GImage"),Gimage,-1);
setmenu(ImageOpenExternal,macro,_("View Page GImage"),G_PageImage,-1);
}

$OnInit=$OnInit."_Gimage_BuildMenu;";

# -------------------------------------------------------------------------------------------------
$macroModules=$macroModules."Google Image;";

K-Meleon in Spanish



Edited 2 time(s). Last edit at 10/29/2008 01:47PM by desga2.

Re: google image search "remove frame" issue
Posted by: Arrow
Date: October 30, 2008 03:52AM

Thanks desga2 it's good to have both options.

K-Meleon forum is powered by Phorum.