General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
New tool for K-Meleon
Posted by: alain aupeix chez wanadoo fr
Date: November 29, 2005 06:07PM

I have made a tool which validate/unvalidate a plugin (I think of this when I was trying the Fred Plus-2 version).

My tool rename and give if needed an alert message to restart K-Meleon.

The macro Active_X uses this tool, changes a pref value, and check the entry in the menu

The only thing I don't know is to make a macro to verify in OnStartup()

Here is how it works:

Active_X {
$plug="npmozax.dll";
&toggleplug;
}

toggleplug {
exec("\"tools\\Km_Plugs.exe\" N Y \"".$pluginsdir."..\\plugins\\\" ".$plug);
togglepref(BOOL,"kmeleon.netplug.".$plug);
setcheck("macros(Active_X)",getpref(BOOL,kmeleon.netplug.".$plug)); &Sync;
}

toggleplug() can obviously be used for others plugins

Sync {
...
setcheck("macros(Active_X)",getpref(BOOL,"kmeleon.netplug.npmozax.dll"));
...
}

It works well now. Remame use the same way as npchooser to be compatable with it.

I thought to a luamacros to verify if the dll is here to in the lua macro or in OnStartup to update the value of the pref, before running &Sync.
This to eliminate a possible error due to a rename out of K-Meleon, or in npchooser.

OnStartup{
$active =pluginmsg(luamacros(checkplug,\"".$pluginsdir."..\\plugins\\npmozax.dll\""));
$active == 0 ? $plug=true:$plug=false;
setpref(BOOL,"kmeleon.netplug.npmozax.dll",$plug);

&SetLast;
$layer=="true"? &SetNext:setpref(STRING,$og,$ln);
getpref(INT,$sg)<2 ? "":$loaded="GroupStart"; &Sync;
}

If anybody can help for luamacro. I think file functions ought to be added in luamacros.dll to allow to do file check or others things, and why not to replace my last tool Km_plugs

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: alain aupeix chez wanadoo fr
Date: November 29, 2005 06:08PM

I'll make a french/english version and put it on my site to morrow probably.

For this evening, I'll look at the last posts on Noscript.

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: alain aupeix chez wanadoo fr
Date: November 29, 2005 06:15PM

I think of another tool, which will kill and reload K-Meleon loader when quitting K-Meleon if needed. For example with all the modifications which needed to quit and launch K-Meleon.
The only problem is the name of the loader. It should be good to change or add a class to it to easily identificate it to close it.

If somebody can make the modification to Loader.exe, it will be great.

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: bst82551
Date: November 29, 2005 06:40PM

The first time I tried opening this thread, I got this error:
http://brian2006.be:8181/pics/SS/forum-error.jpg

Umm... but once I went back to the forum and tried again, it worked fine. Just thought I'd point it out.

Brian

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: alain aupeix chez wanadoo fr
Date: November 29, 2005 06:46PM

An error in the first post:

toggleplug {
exec("\"tools\\Km_Plugs.exe\" N Y \"".$pluginsdir."..\\plugins\\\" ".$plug);
togglepref(BOOL,"kmeleon.netplug.".$plug);
&Sync;
}

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: 307
Date: November 30, 2005 08:47AM

There are "io.open" and "os.rename" in Lua standard library. But they are disabled on current luamacros. If they are enebled, luamacros.dll will grow about +10K bytes.

BTW. K-Meleon's macro is extendable by plugin. It is maybe io plugin what you want, for example:

$check = pluginmsgex(io, "exist", $file, STRING);
pluginmsg(io, "rename", $from, $to);
$contents = pluginmsgex(io, "read", $file, STRING);
pluginmsg(io, "write", $file, $contents);

But plugin uses memory when you don't use it (luamacros is too).

Thanks.

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: guenter
Date: November 30, 2005 11:34AM

thx folks;
- i tried something similar with toggling value between 0 and 9 but failed.

with: user_pref("security.xpconnect.activex.global.hosting_flags", 0);
/* 0 means no hosting of activex controls whatsoever */

the thing did not toggle for some reason.


so i knew only white listing of plugins. Or with banning;

we can explicitly ban a control (with appropriate classid) like this

pref("capability.policy.default.ClassID.CID039ef260-2a0d-11d5-90a7-0010a4e73d9a", "NoAccess");

if we want to explicity enable a control then we can do this:

pref("capability.policy.default.ClassID.CID039ef260-2a0d-11d5-90a7-0010a4e73d9a", "AllAccess");

or make policies:
user_pref("capability.policy.policynames", "trustable");
user_pref("capability.policy.trustable.sites", "http://www.site1.net http://www.site2.net");
user_pref("capability.policy.trustable.ClassID.CID039ef260-2a0d-11d5-90a7-0010a4e73d9a", "AllAccess");

AFAIK we can look at http://lxr.mozilla.org/seamonkey/find?string=nsIActiveXSecurityPolicy.idl
for more combinations and ways.

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: alain aupeix at wanadoo fr
Date: November 30, 2005 12:30PM

The Km Loader Killer works, I'm about to modify the macros concerned to test it.

For the plugin toggler, it works, but I need to make and test lua macro.

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: alain aupeix chez wanadoo fr
Date: November 30, 2005 08:16PM

Km Loader Killer works well out of K-Meleon, but failed from within K-Meleon, because K-Meleon never executes OnQuit() if Loader is in memory.

sad smiley

For the plugin toogler, I'm always waiting for an extended luamacros.

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: 307
Date: December 01, 2005 01:52PM

I like the idea of macro extension plugin.

http://rapidshare.de/files/8432389/utils-0.0.1.zip.html

macro
$plug=pluginmsgex(utils,"exist",$pluginsdir."npmozax.dll",STRING);
setpref(BOOL,"kmeleon.netplug.npmozax.dll",$plug);

Lua
plug=pluginmsgex("utils","exist",pluginsdir.."npmozax.dll",TYPE_STRING)
setpref(TYPE_BOOL,"kmeleon.netplug.npmozax.dll",plug=="true")

It is extensible as easy, because it is simple and small.
Thanks.

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: alain aupeix at wanadoo fr
Date: December 01, 2005 02:53PM

Nice smiling smiley)

I'll try it ...

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: alain aupeix chez wanadoo fr
Date: December 02, 2005 07:35PM

Well, OnStartup modification works:

OnStartup{
$plug=pluginmsgex(utils,"exist",$pluginsdir . "..\\plugins\\npmozax.dll",STRING);
setpref(BOOL,"kmeleon.netplug.npmozax.dll",$plug);

&SetLast;
$layer=="true"? &SetNext:setpref(STRING,$og,$ln);
getpref(INT,$sg)<2 ? "":$loaded="GroupStart"; &Sync;
}

I just have now to rewrite OnQuit() to use util kplugins instead of my external tool km_plugs

Options: ReplyQuote
Re: New tool for K-Meleon
Posted by: alain aupeix chez wanadoo fr
Date: December 02, 2005 08:49PM

The two functions are now complete and work great:

To toggle a plugin:

Active_X{
$plug="npmozax.dll";
$reload = true;
&toggleplug;
}
toggleplug {
$plugpath = $pluginsdir . "..\\plugins\\"
$plug_activ = getpref(BOOL,"kmeleon.netplug.".$plug);
$plug_activ ? $verb = "unactivate " : $verb = "activate ";
$plug_activ ? $action = "Unactivation " : $action = "Activation ";
$plug_activ ? $from = $plugpath . $plug : $from = $plugpath . "_" . $plug;
$plug_activ ? $to = $plugpath . "_" . $plug : $to = $plugpath . $plug;
$x = pluginmsg(utils, "rename", $from, $to);
togglepref(BOOL,"kmeleon.netplug.".$plug);
&Sync;
$msg = "You must close and reload K-Meleon to " . $verb . "the plugin " . $plug
$reload ? alert($msg,$action."of a plugin") : 0;
}

To verify state when starting k-meleon:

OnStartup{
[g]$plug=pluginmsgex(utils,"exist",$pluginsdir . "..\\plugins\\npmozax.dll",STRING);
setpref(BOOL,"kmeleon.netplug.npmozax.dll",$plug);
&SetLast;
$layer=="true"? &SetNext:setpref(STRING,$og,$ln);
getpref(INT,$sg)<2 ? "":$loaded="GroupStart"; &Sync;
}[/g]

The toggleplug macro is obviously generic and can work with any netscape plugin

Parameters initialised in callin function:
name of the dll
reload needed or not (true or false)

That's all folks smiling smiley

Options: ReplyQuote


K-Meleon forum is powered by Phorum.