General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
greasemonkey script [GIR] doesn't work on k-meleon
Posted by: seniorx
Date: December 13, 2011 05:32PM

I've been using greasemonkey[greasemeleon] with google image ripper script, but recently it stopped working. I tested it on firefox and script works fine.
http://userscripts.org/scripts/show/105523

What is wrong?
I don't want to switch to another browser... sad smiley

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: seniorx
Date: December 16, 2011 03:21PM

No one knows?
I reinstalled k-meleon to the newest version (aka "the same"), greasemeleon, and tried other scripts that do the same thing - but for no avail

Why k-meleon sucks so much now (it used to be my browser of choice)? Youtube doesn't support it, greasemonkey scripts don't work

Best regards

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: rodocop
Date: December 16, 2011 05:25PM

what "newest" exactly? 1.5.4?

It's outdated anyway. Usable are the 1.6-beta and 1.7-alpha versions as well as custom builds based on them.

Some beautiful builds you can find in my signature. They are portable, so just unzip and use - add your favourite extensions, browse and so on.

When it comes to Google services the KM-1.7 is definitely more compatible.

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: seniorx
Date: December 16, 2011 07:37PM

I just tried KM-16-S2014 and it still doesn't work on google images.
For K-Meleon-1.7.25db+ link is wrong

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: rodocop
Date: December 16, 2011 09:16PM

Quote
seniorx
For K-Meleon-1.7.25db+ link is wrong

Yes, it is now. Dugbug has upgraded his build to new GRE, so try bookmark this link
http://home.dbdbdugbug.operaunite.com/Projects/content/KMFILES/K-Meleon_1.7/
and look for updated builds if you want.

Current working download link is this one: K-Meleon-1.7.26db+.7z

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: seniorx
Date: December 16, 2011 09:36PM

this version also doesn't make the script work

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: rodocop
Date: December 16, 2011 09:45PM

seems like G changes things too frequently...

And KM-engine became 'too old' in its terms... Sorry...

May be our extensions developers and adopters would be more helpful for you...

P.S. however, try this build in general use - most issues of old versions would be gone...



Edited 1 time(s). Last edit at 12/16/2011 09:51PM by rodocop.

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: JamesD
Date: December 16, 2011 11:40PM

@ seniorx

What is the script trying to get done? I do not know Google or GreaseMonkey, but maybe something can be done in KM's MacroLanguage.

Hanlon’s razor is an eponymous adage named after Robert J. Hanlon that states: “Never attribute to malice that which is adequately explained by stupidity.”

JamesD

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: seniorx
Date: December 17, 2011 08:00AM

http://userscripts.org/scripts/show/105523

It basically displays target images on google image search
http://s3.amazonaws.com/uso_ss/5349/large.png

I don't know much about coding but here is the script

// ==UserScript==
// @name Google Image Ripper
// @namespace http://dearcomputer.nl/gir/
// @description No more thumbnails, straight to the good stuff! Rewrites Google Image Search results to show full images instead of the thumbnails.
// @include http://images.google.*/*
// @include http://www.google.*/images?*
// @include http://www.google.*/imghp*
// @include http://www.google.*tbm=isch*
// @include http://*.google.*/imgres?imgurl=*
// @include http://*.google.*/search?q=*

// @include https://images.google.*/*
// @include https://www.google.*/images?*
// @include https://www.google.*/imghp*
// @include https://www.google.*tbm=isch*
// @include https://*.google.*/imgres?imgurl=*
// @include https://*.google.*/search?q=*

// @version 1.8
// ==/UserScript==

// ==CHANGELOG==
// ver 1.0 - 2008.10.13
// - initial release
//
// ver 1.1 - 2009.07.16
// - fixed after changed google image search markup
//
// ver 1.2 - 2009.12.04
// - fixed after another google markup change
// - added version number to modified title
// - improved javascript for logo DOM modification
//
// ver 1.3 - 2010.01.19
// - linked images to original hosting pages (thnx to shake & freecyber for suggestions)
//
// ver 1.4 - 2010.05.10
// - fixed after a google url change
//
// ver 1.4.1 - 2010.05.13
// - improved include settings

// 1.5 - Combined the GIR and GIB
// 1.6 - Fixed some page permissions
// 1.7 - Google changed the element ID for the image table. Took me a while to figure it out. Should
// work without issue now.
// 1.8 - Added an extra include statement.

(function () {

if ((/q=/).test(document.location.href)) {
if (!(/&sout=1/).test(document.location.href)) {
window.location = window.location + "&sout=1";
}
}
})();

(function() {

// Get list of all anchor tags that have an href attribute containing the start and stop key strings.
var fullImgUrls = selectNodes(document, document.body, "//a[contains(@href,'/imgres?imgurl\x3d')][contains(@href,'\x26imgrefurl=')]");

//clear existing markup
var imgContent = document.getElementById('center_col');
imgContent.innerHTML = "";

for(var x=1; x<=fullImgUrls.length; x++) {
//reverse X to show images in correct order using .insertBefore imgContent.nextSibling
var reversedX = (fullImgUrls.length) - x;
// get url using regexp
var fullUrl = fullImgUrls[reversedX].href.match( /\/imgres\?imgurl\=(.*?)\&imgrefurl\=(.*?)\&usg/ );
// if url was fetched, create img with fullUrl src
if(fullUrl) {
newLink = document.createElement('a');
imgContent.parentNode.insertBefore(newLink , imgContent.nextSibling);
newLink.href = unescape(fullUrl[2]);
newElement = document.createElement('img');
newLink.appendChild(newElement);
newElement.src = decodeURI(fullUrl[1]);
newElement.border = 0;
newElement.title = fullUrl[2];
}
}

function selectNodes(document, context, xpath) {
var nodes = document.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var result = [];
for (var x=0; x<nodes.snapshotLength; x++) {
result.push(nodes.snapshotItem(x));
}
return result;
}

})();

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: JamesD
Date: December 19, 2011 03:59PM

@seniorx

I have looked at the script and for sure I do not know Greasemonkey. I think it could be done with Javascript and injectJS, but I am no expert in JS or document object model coding. Sorry I could not help.

Hanlon’s razor is an eponymous adage named after Robert J. Hanlon that states: “Never attribute to malice that which is adequately explained by stupidity.”

JamesD

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: rodocop
Date: December 20, 2011 02:27PM

seniorx,
I have a solution for you!

If you are familiar with JS, you can find it even more convenient than it was for me.

Install javascriptia extension.
Save your JS as file on disk (any name, any file extension, any folder) and use it on the Google results page from menu "Bookmarks" or from context-menu 'Inject a script' - select your file and that's it! (Maybe it would be required to perform this once again - depending on default Google search results display settings.

I can't understand this but one of my KMs (1.6 db+) shows me modern 'Full version' where only squared thumbs are displayed and all details are shown only when mouseover - here I also have a link for switching to old-fashioned 'Simple version' which is exactly same as what is parsed in your case illustrated by screenshot; and other KM (1.7.25db+) shows only this 'simple' one without switching link to 'full'.
So here are 2 different and strongly dependent behaviors: javascriptia works for me only with 1.6 build and using of your JS first converts 'full' version of results page to 'simple' and being called once again makes what you want - rips results to full resolution images.


And this extension don't work in 1.7 build - I don't know whether it applies to 1.7 branch in general, to this build only or to using this particular script...
But I think all these effects are tightly connected - somehow :O


If you are really familiar with scripting and config-editing, you can also setup javascriptia to execute script automaticaly after loading specific pages (in your case - Google search).
You only need to read the corresponding .kmm-file and make your changes there in accordance with existing explanations and syntax.
I can't help you more as I haven't enough competence in scripting and editing txt-configs.
We can hope that siria, author of javascriptia, can help more, if needed. You can also read corresponding thread for further reference



Edited 4 time(s). Last edit at 12/20/2011 03:30PM by rodocop.

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: seniorx
Date: December 21, 2011 12:06PM

Ok, thanks man. It works!

Doesn't work on 1.7 but does on 1.6 and 1.5.4 (that I'm still using)
I edited the .kmm script and it does it automatically. I can disable javascript alltogether (to remove all the bullshit from websites) and macro still functions on google.

Options: ReplyQuote
Re: greasemonkey script [GIR] doesn't work on k-meleon
Posted by: rodocop
Date: December 21, 2011 02:36PM

Great!

You can use any JS this way, so it's good replacement for Greasemeleon and bookmarklets...

Options: ReplyQuote


K-Meleon forum is powered by Phorum.