Re: importing greasemonkey to k-meleon
Posted by: Hao Jiang
Date: February 27, 2007 04:52PM

The injectJS() and injuctCSS() macros/lua macros can mimic the way greasemonkey is currently. Maybe it's possible to write a lua macros to make this easier.

Re: importing greasemonkey to k-meleon
Posted by: guenter
Date: February 28, 2007 05:25AM

simon, the greasemonkey extension does not work for either SeaMonkey or K-Meleon. It might be possible to use it when they fixed the extension for use with SeaMonkey. But i IMHO Hao points at the right spot - we can mimic the function sufficiantly - since You do not need the feature every day.

SeaMonkey 1.1 and K-Meleon with experimental SeaMonkey xpi installer service do not install greasemonkey

/greasemonkey
Failed to create chrome directory
You probably don't have appropriate permissions
(write access to Profile/chrome directory).

Error code :-214

A cross test successfully installed a Console2 chrome/extension.


As a start I had created a greasmonkey.jar, SeaMonkey style obsolete content.rdf and installed-chrome.txt, a little K-Meleon chrome calling macro // since my PC is faster with unpacking than I/O operations anyway smiling smiley And it looked sufficiently good to try.

Both SeaMonkey ErrorConsole and K-Meleon Console2 point to an error that prevents the loading of browser.xul.

A K-Meleon 1.1beta3, with*.kmm, chrome.dll and xpt that can handle chrome manifest files and a Firefox style test chrome except that only did not have unused Firefox stuff in browser.jar ( = Xulrunner chrome plus branding ) threw the same error. *

SeaMonkey:
Error: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIFileProtocolHandler.getFileFromURLSpec]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: chrome://greasemonkey/content/utils.js :: getContentDir :: line 237" data: no]

K-Meleon:
Error: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIFileProtocolHandler.getFileFromURLSpec]
Source file: chrome://greasemonkey/content/utils.js
Line: 237


Which would be in:

function getContentDir() {
var reg = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
.getService(Components.interfaces.nsIChromeRegistry);

var ioSvc = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);

var proto = Components.classes["@mozilla.org/network/protocol;1?name=file"]
.getService(Components.interfaces.nsIFileProtocolHandler);

var chromeURL = ioSvc.newURI("chrome://greasemonkey/content", null, null);
var fileURL = reg.convertChromeURL(chromeURL);
var file = proto.getFileFromURLSpec(fileURL.spec).parent; // this line = 237
return file
}

I replaced part of this function with code from kmprefs.jar but it threw another error further down. This looks like a barrel without bottom and K-Meleon project does not have redundant manpower. There are more urgent things for those that are more competent than me & the ppl that need this extension can use Firefox for it.

Re: importing greasemonkey to k-meleon
Posted by: BenoitRen
Date: February 28, 2007 09:08AM

Actually, greasemonkey does exist for SeaMonkey: http://xsidebar.mozdev.org/modifiedmisc.html#greasemonkey

Re: importing greasemonkey to k-meleon
Posted by: guenter
Date: March 01, 2007 01:39PM

BenoitRen, thx for shipping in the info, but

Quote
BenoitRen
Actually, greasemonkey ... for SeaMonkey: http://xsidebar.mozdev.org/modifiedmisc.html#greasemonkey

causes the same type of errors with SeaMonkey 1.1 sad smiley

p. s. the extensions from that site are always the best bet for us.



Edited 1 time(s). Last edit at 03/01/2007 01:43PM by guenter.

Re: importing greasemonkey to k-meleon
Posted by: mark307
Date: March 02, 2007 02:13PM

I don't know well about greasemonkey, so this script may be wrong.
-- inject_script.lua
require "hook"
inject_script = {}

local function OnLoad()
  local url = km.GetGlobalVar(TYPE_STRING, "URL")
  local scheme, host, path = string.match(url, "([^/:]+)://([^/]+)(.*)")
  if scheme ~= "http" or not host or not inject_script[host] then
    return
  end
  local k, v
  for k, v in pairs(inject_script[host]) do
    if string.match(path, k) then
      km.InjectJS(v, true)
    end
  end
end
hook.add(LoadHook, OnLoad)

-- your_script.lua
inject_script["kmeleon.sourceforge.net"] = {
  ["^/$"] = 'alert("Welcome!!");',
  ["^/forum/$"] = 'alert("Are you spammer?");',
}
thank you.

Re: importing greasemonkey to k-meleon
Posted by: BenoitRen
Date: March 05, 2007 11:34PM

guenter, did you also install xSidebar? A handful extensions on that page depend on it. It provides several functions that SeaMonkey doesn't have but Firefox does.

Re: importing greasemonkey to k-meleon
Posted by: guenter
Date: March 06, 2007 07:00AM

@Mark307, Thank You for Your generous help and Your posting for us to read.

@BenoitRen, As far as I have seen - It is not specifically required for this one since it is a global application. Maybe try differnt versions of sidebar and browser? From its structure this application could work. SM cookie handler is very similar. The category listing does not work because it cannot find its directories - that is how I read the messages. IMHO Marcs solution is good for the use.



Edited 1 time(s). Last edit at 03/06/2007 07:13AM by guenter.

GreaseMeleon 1.0 (GreaseMonkey for K-Meleon)
Posted by: oi nerds
Date: June 19, 2007 06:53AM

http://kmeleonbrowser.org/forum/read.php?1,72670



---------------------------------------------------------

Official Release. June 16th, 2007

Requeriments:
K-Meleon 1.1 or higher
http://kmeleon.sourceforge.net/wiki/Download

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

GreaseMeleon 1.0 - Download
http://rapidshare.com/files/37471220/GreaseMeleon.zip.html

Install:
Extract to your K-Meleon directory

Ex:
C:\Program Files\K-Meleon
C:\Arquivos de Programas\K-Meleon

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

This version is language Portuguese-Brazilian.
I need only one site to update and to make available different languages.
if someone is interested enough to make one site, contact me via post.


by oi nerds - cLaN oi
Orkut: http://www.orkut.com/Community.aspx?cmm=27114108
MSN: buggeroi@hotmail.com


K-Meleon forum is powered by Phorum.