List Info

Thread: Thumbs extension




Thumbs extension
user name
2007-10-13 18:16:54
I'm trying to get my feet wet with some extension
translation and I've
decided to work with a extension I use frequently and isn't
dll based.
The thumbs extension available at
ht
tps://addons.mozilla.org/en-US/firefox/addon/234 is the
one I
borrowed. I am aware that k-meleon doesn't support
install.rdf files
so I built an install.js file using bugmenot as a template.
It also
didn't seem to contain a thumbs.manifest so I created one. I
can't
seem to find a mechanism to 'install' this extension,
although I can
now access the files via urls such as
chrome://thumbs/skin/thumbsOverlay.css which seems to
indicate it is
indeed registered. The problem I think exists is that the
thumbs
extension when installed on firefox somehow registers a
right click
menu addition that obviously isn't getting registered in
k-meleon.
Does the install.js somehow get called automatically? when
loading it
in k-meleon it just displays the javascript. I'm assuming
its this
install process which adds the context menu stuff. From my
(limited)
understand the only thing then required would be to write a
kmm macro
that would add the link to the right click menu and pass it
all the
highlighted links as parameters. Any reference of something
else I'd
be able to glance at to figure out what I must do to get
this
extension working under k-meleon?  My generated install.js
and
thumbs.manifest are attached below

--install.js--
// XpiInstaller
// By Pike (Heavily inspired by code from Henrik Gemal and
Stephen Clavering)

var XpiInstaller = {

	// --- Editable items begin ---
	extFullName: 'Thumbs', // The name displayed to the user
(don't
include the version)
	extShortName: 'thumbs', // The leafname of the JAR file
(without the .jar part)
	extVersion: '1.0',
	extAuthor: 'Eric Hamiter',
	extLocaleNames: 'en-US', // e.g. ['en-US', 'en-GB']
	extSkinNames: 'classic', // e.g. ['classic', 'modern']
	extPostInstallMessage: 'Success! Please restart your
browser to
finish the installation.', // Set to null for no
post-install message
	// --- Editable items end ---

	profileInstall: true,
	silentInstall: false,

	install: function()
	{
		var jarName = this.extShortName + '.jar';
		var profileDir = Install.getFolder('Profile', 'chrome');

		// Parse HTTP arguments
		this.parseArguments();

		// Check if extension is already installed in profile
		if (File.exists(Install.getFolder(profileDir, jarName)))
		{
			if (!this.silentInstall)
			{
				Install.alert('Updating existing Profile install of ' +
this.extFullName + ' to version ' + this.extVersion + '.');
			}
			this.profileInstall = true;
		}
		else if (!this.silentInstall)
		{
			// Ask user for install location, profile or browser
dir?
			this.profileInstall = Install.confirm('Install ' +
this.extFullName
+ ' ' + this.extVersion + ' to your Profile directory (OK)
or your
Browser directory (Cancel)?');
		}

		// Init install
		var dispName = this.extFullName + ' ' + this.extVersion;
		var regName = '/' + this.extAuthor + '/' +
this.extShortName;
		Install.initInstall(dispName, regName, this.extVersion);

		// Find directory to install into
		var installPath;
		if (this.profileInstall) installPath = profileDir;
		else installPath = Install.getFolder('chrome');

		// Add JAR file
		Install.addFile(null, 'chrome/' + jarName, installPath,
null);

		// Register chrome
		var jarPath = Install.getFolder(installPath, jarName);
		var installType = this.profileInstall ?
Install.PROFILE_CHROME :
Install.DELAYED_CHROME;

		// Register content
		Install.registerChrome(Install.CONTENT | installType,
jarPath,
'content/' + this.extShortName + '/');

		// Register locales
		for (var locale in this.extLocaleNames)
		{
			var regPath = 'locale/' + this.extLocaleNames[locale] +
'/' +
this.extShortName + '/';
			Install.registerChrome(Install.LOCALE | installType,
jarPath, regPath);
		}

		// Register skins
		for (var skin in this.extSkinNames)
		{
			var regPath = 'skin/' + this.extSkinNames[skin] + '/' +
this.extShortName + '/';
			Install.registerChrome(Install.SKIN | installType,
jarPath, regPath);
		}

		// Perform install
		var err = Install.performInstall();
		if (err == Install.SUCCESS || err ==
Install.REBOOT_NEEDED)
		{
			if (!this.silentInstall &&
this.extPostInstallMessage)
			{
				Install.alert(this.extPostInstallMessage);
			}
		}
		else
		{
			this.handleError(err);
			return;
		}
	},

	parseArguments: function()
	{
		// Can't use string handling in install, so use if
statement instead
		var args = Install.arguments;
		if (args == 'p=0')
		{
			this.profileInstall = false;
			this.silentInstall = true;
		}
		else if (args == 'p=1')
		{
			this.profileInstall = true;
			this.silentInstall = true;
		}
	},

	handleError: function(err)
	{
		if (!this.silentInstall)
		{
			Install.alert('Error: Could not install ' +
this.extFullName + ' '
+ this.extVersion + ' (Error code: ' + err + ')');
		}
		Install.cancelInstall(err);
	}
};

XpiInstaller.install();


--thumbs.manifest

overlay   chrome://browser/content/browser.xul
chrome://thumbs/content/thumbsOverlay.xul
overlay   chrome://navigator/content/navigator.xul
chrome://thumbs/content/thumbsOverlay.xul
content   thumbs jar:thumbs.jar!/content/
skin      thumbs classic jar:thumbs.jar!/skin/
style     chrome://global/content/customizeToolbar.xul
chrome://thumbs/skin/thumbsOverlay.css
locale    thumbs en-US jar:thumbs.jar!/locale/en-US/

------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Kmeleon-dev mailing list
Kmeleon-devlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kmeleon-dev


Thumbs extension
country flaguser name
Germany
2007-10-14 07:00:59
Hi Sebastian Val,

Mozilla/SeaMonkey installer service has not been used/added
for security 
reasons.
It would have allowed users to install incompatible
extensions.
Firefox installer service is not available for K-Meleon at
the moment.


You will find info about existing extensions via this
thread: 
http:
//kmeleon.sourceforge.net/forum/read.php?1,72013,page=5

You will find prototypes and info for the current K-Meleon
installer 
service.
NSIS setup was also chosen for now and the near future:
http://perso.orange.fr/jujuland46/Ju
juLand/KMES/KMES-Generalities.html#kinds

Index pages via: 
http://perso.orange.fr/jujuland46/JujuLand
/KMES/KMES-Generalities.html

The page also contains a K-Meleon extension that helps with
to test 
Xul-applications:
http://perso.orange.fr/jujuland46/JujuLand
/KMES/K-Ext110_JarTester.exe
With the manifest files that extension lets You start a
extension.
That and a look into Console2 tells You whether You have a
good/bad chance.
If You have a chance - Console shows You also what You have
to edit/alter.

Documentation for writing manifest file by hand: 

http://developer.mozilla.org/en/docs/Chrome_Manifest
If I write by hand I use an existing example and alter it
(but I try to 
avoid this procedure)
Manifest files can be easiest auto created by K-Meleon. You
just run a 
correct: installed-chrome.txt.
The name of the manifest cretaed by K-Meleon:
app-chrome.manifest. I 
scavenge that.
(K-Meleon always creates an app-chrome.manifest when no file
with the 
name exists in chrome folder and a installed-chrome.txt is
found at startup)

One problem: AFAIK Your extension wants to manipulate a XUL
interface 
that K-Meleon does not have.
But I am not sure. IMHO Your procedures should lead to
success if the 
extension is compatible. Console2 will tell You.
The last word has the experiment, said the chemist before he
blew up the 
laboratory 

Sebastian Val schrieb:
> I'm trying to get my feet wet with some extension
translation and I've
> decided to work with a extension I use frequently and
isn't dll based.
> The thumbs extension available at
> ht
tps://addons.mozilla.org/en-US/firefox/addon/234 is the
one I
> borrowed. I am aware that k-meleon doesn't support
install.rdf files
> so I built an install.js file using bugmenot as a
template. It also
> didn't seem to contain a thumbs.manifest so I created
one. I can't
> seem to find a mechanism to 'install' this extension,
although I can
> now access the files via urls such as
> chrome://thumbs/skin/thumbsOverlay.css which seems to
indicate it is
> indeed registered. The problem I think exists is that
the thumbs
> extension when installed on firefox somehow registers a
right click
> menu addition that obviously isn't getting registered
in k-meleon.
> Does the install.js somehow get called automatically?
when loading it
> in k-meleon it just displays the javascript. I'm
assuming its this
> install process which adds the context menu stuff. From
my (limited)
> understand the only thing then required would be to
write a kmm macro
> that would add the link to the right click menu and
pass it all the
> highlighted links as parameters. Any reference of
something else I'd
> be able to glance at to figure out what I must do to
get this
> extension working under k-meleon?  My generated
install.js and
> thumbs.manifest are attached below
>
> --install.js--
> // XpiInstaller
> // By Pike (Heavily inspired by code from Henrik Gemal
and Stephen Clavering)
>
> var XpiInstaller = {
>
> 	// --- Editable items begin ---
> 	extFullName: 'Thumbs', // The name displayed to the
user (don't
> include the version)
> 	extShortName: 'thumbs', // The leafname of the JAR
file (without the .jar part)
> 	extVersion: '1.0',
> 	extAuthor: 'Eric Hamiter',
> 	extLocaleNames: 'en-US', // e.g. ['en-US', 'en-GB']
> 	extSkinNames: 'classic', // e.g. ['classic',
'modern']
> 	extPostInstallMessage: 'Success! Please restart your
browser to
> finish the installation.', // Set to null for no
post-install message
> 	// --- Editable items end ---
>
> 	profileInstall: true,
> 	silentInstall: false,
>
> 	install: function()
> 	{
> 		var jarName = this.extShortName + '.jar';
> 		var profileDir = Install.getFolder('Profile',
'chrome');
>
> 		// Parse HTTP arguments
> 		this.parseArguments();
>
> 		// Check if extension is already installed in
profile
> 		if (File.exists(Install.getFolder(profileDir,
jarName)))
> 		{
> 			if (!this.silentInstall)
> 			{
> 				Install.alert('Updating existing Profile install of
' +
> this.extFullName + ' to version ' + this.extVersion +
'.');
> 			}
> 			this.profileInstall = true;
> 		}
> 		else if (!this.silentInstall)
> 		{
> 			// Ask user for install location, profile or browser
dir?
> 			this.profileInstall = Install.confirm('Install ' +
this.extFullName
> + ' ' + this.extVersion + ' to your Profile directory
(OK) or your
> Browser directory (Cancel)?');
> 		}
>
> 		// Init install
> 		var dispName = this.extFullName + ' ' +
this.extVersion;
> 		var regName = '/' + this.extAuthor + '/' +
this.extShortName;
> 		Install.initInstall(dispName, regName,
this.extVersion);
>
> 		// Find directory to install into
> 		var installPath;
> 		if (this.profileInstall) installPath = profileDir;
> 		else installPath = Install.getFolder('chrome');
>
> 		// Add JAR file
> 		Install.addFile(null, 'chrome/' + jarName,
installPath, null);
>
> 		// Register chrome
> 		var jarPath = Install.getFolder(installPath,
jarName);
> 		var installType = this.profileInstall ?
Install.PROFILE_CHROME :
> Install.DELAYED_CHROME;
>
> 		// Register content
> 		Install.registerChrome(Install.CONTENT | installType,
jarPath,
> 'content/' + this.extShortName + '/');
>
> 		// Register locales
> 		for (var locale in this.extLocaleNames)
> 		{
> 			var regPath = 'locale/' +
this.extLocaleNames[locale] + '/' +
> this.extShortName + '/';
> 			Install.registerChrome(Install.LOCALE | installType,
jarPath, regPath);
> 		}
>
> 		// Register skins
> 		for (var skin in this.extSkinNames)
> 		{
> 			var regPath = 'skin/' + this.extSkinNames[skin] +
'/' +
> this.extShortName + '/';
> 			Install.registerChrome(Install.SKIN | installType,
jarPath, regPath);
> 		}
>
> 		// Perform install
> 		var err = Install.performInstall();
> 		if (err == Install.SUCCESS || err ==
Install.REBOOT_NEEDED)
> 		{
> 			if (!this.silentInstall &&
this.extPostInstallMessage)
> 			{
> 				Install.alert(this.extPostInstallMessage);
> 			}
> 		}
> 		else
> 		{
> 			this.handleError(err);
> 			return;
> 		}
> 	},
>
> 	parseArguments: function()
> 	{
> 		// Can't use string handling in install, so use if
statement instead
> 		var args = Install.arguments;
> 		if (args == 'p=0')
> 		{
> 			this.profileInstall = false;
> 			this.silentInstall = true;
> 		}
> 		else if (args == 'p=1')
> 		{
> 			this.profileInstall = true;
> 			this.silentInstall = true;
> 		}
> 	},
>
> 	handleError: function(err)
> 	{
> 		if (!this.silentInstall)
> 		{
> 			Install.alert('Error: Could not install ' +
this.extFullName + ' '
> + this.extVersion + ' (Error code: ' + err + ')');
> 		}
> 		Install.cancelInstall(err);
> 	}
> };
>
> XpiInstaller.install();
>
>
> --thumbs.manifest
>
> overlay   chrome://browser/content/browser.xul
> chrome://thumbs/content/thumbsOverlay.xul
> overlay   chrome://navigator/content/navigator.xul
> chrome://thumbs/content/thumbsOverlay.xul
> content   thumbs jar:thumbs.jar!/content/
> skin      thumbs classic jar:thumbs.jar!/skin/
> style     chrome://global/content/customizeToolbar.xul
> chrome://thumbs/skin/thumbsOverlay.css
> locale    thumbs en-US jar:thumbs.jar!/locale/en-US/
>
>
------------------------------------------------------------
-------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? 
Stop.
> Now Search log events and configuration files using
AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Kmeleon-dev mailing list
> Kmeleon-devlists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kmeleon-dev

>
>   


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Kmeleon-dev mailing list
Kmeleon-devlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kmeleon-dev


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )