I'm sorry. "os" library is also disabled on 0.0.4. I forgot it.
I think, while someone has a fear about accessing files from this plugin, I should not enable it. Then I suggest you to make a plugin like I posted on general forum. Lua plugin can call the plugin too.
I'm sorry. "os" library is also disabled on 0.0.4. I forgot it.
Then I suggest you to make a plugin like I posted on general forum. Lua plugin can call the plugin too.
I'm not able to do that
I would ne nice to have a version with os() and io() : no more needed of external tools,
someone has a fear about accessing files from this plugin
I think it's stupid ... we are not with IE, Windows doesn't know how to handle it, and how can a program interpret a macro in lua file or macros.cfg.
I don't know.. I, for one, prefer more control. But that's because I don't have evil intents . (And because my computer has the power to run everything.)
> > someone has a fear about accessing files from this plugin
> I think it's stupid ... we are not with IE, Windows doesn't know how to handle it, and how can a program interpret a macro in lua file or macros.cfg.
But what if I decide to write a script that deletes C:\*.*, post it somewhere, and trick people into using it?
You see, many viruses act that way: you think it's a game or a useful program or whatever, but it's not.
But what if I decide to write a script that deletes C:\*.*
Perhaps, but it's the same with wsh scripts we can embed in macros.cfg, and I never heard somebody talking about.
So, with Km macro system, we have no way to only test about a file presence (what I need now) . I think some improvements are necessary, and we are stupid to forbid ourselves to make it.
Yeah, I guess there are ways to do malicious things with macros.dll's exec() function and the javascript access, too.
Alright, at least for now I believe it's OK to enable the 'dangerous' libraries/functions. So I withdraw my objections :-) . Still there's the file size issue (I personally don't care, though), and that "macro extension plugin" is also a very good idea (we can add all the bloat there). Dunno, anything that works is fine for me....
Offtopic: This makes me think of the Macro Library; we don't (and can't and won't) have safety control over the macros there. Perhaps we should put up a big notice in the parent wikipage (MacroLibrary) stating out that fact, just for precaution.
maybe have a additional version that does not have the possible gaps activated,
but only if that extra option does not mean too much extra work.
p. s. We can always count on the obsurity of beeing such a small group and also
spoof the browser name. So i feel the possibly gaps are not dangerous now.
If macros.lua has error, this plugin doesn't work. And 0.1.0 has a bug that an error message doesn't appear while evaluating macros.lua. But the plugin appears always on preferences dialog. Please check.
@MARK307,
Thanks for the reply. Actually this un-recognizing plugin problem is related with GRE, for some GRE, it could be recognized very well. And for some, it 's not. Don't know why. But anyway, I tried to figure it out which Gecko 1.8 GRE is working fine with this plugin. Thanks.
@Hao
I don't know why, sorry. I know nothing about GRE. If the cause of this problem is compiler, utils plugin is too.
@Dorian
Lua 5.0 doesn't have lua_Integer. Lua language doesn't have integer type still 5.1 beta. And I thought real number is needless for k-meleon's macro.
But you're already using function which are available only in lua 5.1, so it shouldn't be a problem now. All those conversions from float to integer are really bad.
Fix: Error message don't appear while evaluating macros.lua.
Change: Lua 5.1 RC
Change: Lua library is linked as dll.
Change: all standard library is enabled.
Change: number is double (Lua default).
Change: "choose" function returns two value.
Change: K-Meleon's API is in namespace "km" and global.
Add: sample scripts: javascript, viewlinks, privacy
Add: ClearCache, BroadcastMessage, ExitHook
Add: preference "kmeleon.plugins.luamacros.path"
@Dorian
Because Lua addon libraries also need Lua library. If plugin is linked staticaly, these library must be linked staticaly (or you have to put on lua dll). I think it's waste.
I want to know why you think so. I need your wisdom.
Do you mean that, by linking the plugin to a dll, it's possible to use addon libraries and add new fuctions to the plugin ?
It's just that I prefer keeping things tight, and for a plugin, you need a good reason for splitting it like that since no other component will ever need the lua dll.
@Dorian
Yes, you're right. Already I'm writing common dialog addon for Lua. And I succeeded to use LuaFileSystem and LuaSocket with this plugin.
Because utils plugin was accepted, I thought K-Meleon's macro needs more function. Then I tried to give more power to this plugin on last version.
In the fact, I'm at a loss about a position of this plugin. I am almost satisfied, because I can write a macro comfortably, and I made sure that we had common awarenesses of the issues about macro language.
@ra
I see it's range of JavaScript. Lua macro and normal macro can't access HTML.
However, If you can select urls to open from only urls (no text, no image), ListLinks (contained luamacros package) and below MultiPasteGo script are maybe useful.
function MultiPasteGo(hwnd)
local layer, f
layer = km.getpref(km.TYPE_BOOL, "kmeleon.plugins.layers.load")
if layer then
f = function (url)
km.pluginmsg("layers", "OpenURLBg", url)
end
else
f = function (url)
km.NavigateTo(url, km.OPEN_BACKGROUND, hwnd)
end
end
string.gsub(km.getclipboard(hwnd), "(+)",]http://[^%s]+)", f)
end
I think it would be better, to put all needed features in the plugin, and not relying on addon, but well ...
I would have only one request for this plugin: getting rid of the hwnd. It should be possible using environment variables.
Now you could thing about a not really neeeded feature; the possiblity to sign macro to resolve the security problem :o)
@ra
Opening link in the background could be possible using the blur js feature maybe, but it was never implemented in mfcembed. My js knowledge is pretty limited.
I see it's range of JavaScript. Lua macro and normal macro can't access HTML.
Too bad. ;-(
However, If you can select urls to open from only urls (no text, no image), ListLinks (contained luamacros package) and below MultiPasteGo script are maybe useful.
True, thank you. Sadly it won't help in most of the cases.
Opening link in the background could be possible using the blur js feature maybe, but it was never implemented in mfcembed. My js knowledge is pretty limited.
Okay, thanks for the info. Background is not that important, but a fix for the limitation to 20 windows is. I have no idea why the open all links macro opens only 20 windows. It's useless that way. ;-(
BTW: Is there a way to sort out duplicate stuff (array and remove duplicates)?
Oops, MultiPasteGo script is broken by BBS oTL
I'll publish it again with next release. Sorry...
@Dorian
If you look this plugin as alternative of macro plugin, I suggest you to take thought with other choices, e.g. refining macro, spidermonkey. And I see addon topic needs interval to make sure both pluses and minuses.
BTW. I'll challenge to solve hwnd problem. But I see it's difficult... I understand that environment can associate with function not evaluation context.
@ra BTW: Is there a way to sort out duplicate stuff (array and remove duplicates)?
This is change for ListLinks script.
LstL={};
with(LnkW.document){
...
if (! LstL[DlnK[lNK].href]) {
write(DlnK[lNK].href.link(DlnK[lNK])+'<br>');
LstL[DlnK[lNK].href]=1;
}
You can also use JavaScript part of ListLinks with normal macro, but all tabs and newlines have to be removed.