Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Pages: 12Next
Current Page: 1 of 2
Quick Note extension for K-Meleon75.1?
Posted by: as_983
Date: September 24, 2015 07:59PM

Does anybody know how to make it work? I really need this extension.

Thanks!

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: September 25, 2015 12:27AM

I've made the package for KM75.
Unpack to KM folder, restart and enjoy!

Use Ctrl+Alt+Q hotkey or Tools->QuickNote->QuickNote menu item to call QuickNote Window.

Sorry, quick sending page or selected text from context-menu to QuickNote doesn't work (it uses kplugin which is old or even broken - doesn't work in 1.6 too) so I've swithched off corresponding commands from macro (commented them).

If someone could recompile utils.dll for work with KM75 - these options could be easily added back to macro.

Attachments: quicknote75.7z (141.7 KB)  
Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: September 25, 2015 12:51AM

One more useful thing that I should recommend - is the attached set of macros added by JamesD to the last 1.6-build which he maintained in the darkest times of K-Meleon. :cool:

They add a lot of new functionality and 3 of them seem to be very nice and useful supplement for QuickNote (they even can fully replace it for some users).

The most interesting is the Note4me macro providing fast clipping of selected text to predefined file - and every clipping has its date and page reference.

I've slightly edited this macro (hope James doesn't mind) to add an option to quickly open your notes-file in new tab.

All other stuff is untouched and works as intended by JamesD. All the thanks give to him.
All extra options provided by this package are well explained in Additions.htm, which is also in the box (you should get the new toolbar button for Additions - and descriptional menu items will send you to the corresponding place of HTM-file).
You could find useful also QuickStore (for URLs) and StoreFS (for text input fields data) temporary saving and reuse.

Try and enjoy!



Edited 1 time(s). Last edit at 09/25/2015 12:54AM by rodocop.

Attachments: ExtraJamesD_75.7z (296.2 KB)  
Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: as_983
Date: September 25, 2015 12:36PM

It seems that is not working. When I click on Quick Note only appears blank window.
I tried a second extension and.. Kmeleon has Encountered a Problem and Needs to Close. I use XP. Thanks anyway. grinning smiley

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: September 25, 2015 01:04PM

Strange.
QuickNote definitely works fine here on KM 75.1.

Check the pref 'kmeleon.install_firefox_extension' is present in about:config and set to true.

If not - create it as new 'Boolean' pref with true value. Restart KM.



Edited 2 time(s). Last edit at 09/25/2015 01:05PM by rodocop.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: as_983
Date: September 25, 2015 02:31PM

Ok now works as you said.Sending text doesn't work but there is no help.
Thank you rodocop.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 05, 2015 01:08PM

Quote
rodocop
Sorry, quick sending page or selected text from context-menu to QuickNote doesn't work (it uses kplugin which is old or even broken - doesn't work in 1.6 too) so I've swithched off corresponding commands from macro (commented them).

If someone could recompile utils.dll for work with KM75 - these options could be easily added back to macro.

Utils.dll file no longer required. The append function from utils can be replaced with the following macro statement for KM 75 and later.

    $RETURN = appendfile(FILEPATH, DATA);                                  Since version 75.1

Appends the DATA to the file specified in FILEPATH.
Returns the length if successful or false if file not found.
If the file in FILEPATH does not exist, appendfile will create it.


Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: October 05, 2015 06:52PM

James,
I hardly can realize this new stuff in KMML without working example. Sorry.
Can't you try to implement this call for QuickNote so we'll be able to learn and reproduce this technique for future developments?

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 05, 2015 09:16PM

rodocop

I have not been able to test this. I am not up to date on extensions. If you can make the extension work, I think I have made the code changes correctly.

Edit: I sent you an e-mail with another program (Note4me) yesterday. Same type of code there.

Edit2: New version of QNote.7z Found an error in the first copy.



Edited 2 time(s). Last edit at 10/05/2015 09:40PM by JamesD.

Attachments: QNote.7z (136.9 KB)  
Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: October 05, 2015 11:50PM

Thank you, James, for all your job!

Note4me is very pretty piece of code!

And sorry, but QuickNote sending doesn't seem to work. Error console says there while trying to send something to file:
Error: Wrong number of arguments - expected 1, found 0.

setclipboard()



Edited 2 time(s). Last edit at 10/05/2015 11:51PM by rodocop.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: October 06, 2015 01:02AM

Have tested Note4me with new appendfile command and found that it doesn't handle Unicode

UPD.: nevermind! My bad. All is handled good.
This is just my option to view txt-file isn't set to UTF-8 encoding ;-)



Edited 1 time(s). Last edit at 10/06/2015 01:25AM by rodocop.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 06, 2015 01:24AM

I have tried to make the extension run without success. I did find the error (2 of them) with setclipboard(). I am assuming that that the original macro writer wanted the clipboard cleared. I changed the setclipboard() to setclipboard("") in lines 51 and 62.

The previous error that I found was that an alert() statement was spelled Alert(). KM thinks Alert with a capital is a function name.

At the current time I have these messages:
No chrome package registered for chrome://quicknote/content/quicknote.xul
and
Could not read chrome manifest 'file:///C:/Program%20Files/K-Meleon751_beta/locales/others/others.manifest'.

Does the chrome package provide the information in the short prefs?
$note=getpref(INT,"quicknote.totabint");
$to=getpref(STRING,"quicknote.tab".$note."path");

Is there some pref about allowing extensions that I am supposed to add?

Did the extension run prior to my involvement? I only changed two lines of code and neither were the ones with the errors.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: siria
Date: October 06, 2015 01:25AM

Quite confused code again in the quicknote.kmm - reminds me very much of a quite similar one recently. Looks coded by trial-and-error method, the way I must do with javascript, but sure doesn't help simplicity :cool:

The setclipboard() doesn't harm though, those lines can simply be deleted (guess no need to first empty the clipboard before copying something else into it).

I don't find any SETprefs in the kmm (except 1 that in most cases probably does nothing), only lots of GETprefs, but suppose that's build by the xpi??
Does the "Default Settings" menu list something?

But the kmm still says: Needed files : quicknote.jar
But there's no jar in it anymore, only this:
{C0CB8BA3-6C1B-47e8-A6AB-1FAB889562D9}.xpi
No clue if that still calls the same path, complicated xpi-addons are a mystery to me -> your job, ouf :cool:
Does the url still work that the macro calls?
"chrome://quicknote/content/quicknote.xul"

Edit: oops - we posted simultanously.
(And no, your own edits were clearly fixes, the bugs must have existed before)



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?



Edited 1 time(s). Last edit at 10/06/2015 01:28AM by siria.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: October 06, 2015 01:53AM

All the prefs mentioned are set by internal quicknote.js file from xpi.

Old quicknote macro works fine here (but cannot send text to file). So there is some problem in how the append is driven here not in xul-registration...

And sorry, but setclipboard edits do not fix the inability to send content to notes.



Edited 2 time(s). Last edit at 10/06/2015 02:06AM by rodocop.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: October 06, 2015 02:05AM

About Note4me.

I tried to force encoding in View Note-file macro by adding red line:
_Note4me_View {			 
$_Note4me_ViewPath=getpref(STRING,"k-meleon_Note4me.FPath");
opentab("file:///".$_Note4me_ViewPath);
forcecharset(UTF-8);
}
but with such an addition opentab opens an empty tab (without red line it opens right file)

And if trying to handle forcecharset() as separate macro by command to run this macro from first one - it gives the same result - empty tab.

What I'm doing wrong?

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 06, 2015 03:04AM

Quicknote does not send anything because there is no filespec provided in the variable $to.
_QuickNote_SendText{
$refpage="\n----------------------";
getpref(BOOL,"quicknote.showUrl")==false ? 0:$refpage=$refpage."\n".$URL."\n----------------------";
setclipboard("");
id(ID_EDIT_COPY);
$text=getclipboard();
$text=$refpage."\n".$text;
#pluginmsg(utils, "append", $to, $text);
logmsg("$to is ". $to, warning);
logmsg("$text is ". length($text). " chars.", warning);
appendfile($to, $text);
}

From error console:


This could be something I am doing wrong. I know nothing about extensions.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: siria
Date: October 06, 2015 08:16AM

Quote
JamesD
Quicknote does not send anything because there is no filespec provided in the variable $to

That would confirm my first suspicion that there just are no prefs defined...
Yes may be that the js-file adds them, but the file paths in that file are still empty, until the user fills them (via xul?)

Sigh... but since QuickNote is supposed to work entirely offline, perhaps should finally get my butt up and use it as training addon for a bit understanding of xpi-stuff...



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?



Edited 1 time(s). Last edit at 10/06/2015 08:20AM by siria.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: siria
Date: October 06, 2015 08:35AM

There's nothing like a little own testing :cool:

First, to my embarassment, had the necessary km-firefox-pref typed false, with "addons" instead of "extensions" in the name!! No wonder no addons worked so far on my machine, although mysteriously on yours... Arrgh!! But at least there's hope now other addons will start working too smiling smiley

Second, the prefs do show up in about:config, incl. a default path, so this shouldn't be the prob. Taking another look at the kmm - it just uses wrong pref names!
Just rename all prefs in the kmm from "quicknote.xxx" to "extensions.quicknote.xxx"
Seems to work fine now...

Thinking about it, we can't expect users to know about that necessary km-pref without being told. But the kmm-macros (if existing) will still run and could check at startup if that pref is true. If not, it could either show an automatic "shall I set this pref?" question to the user, or handly it silently (still with info-popup to restart again?). But it depends from the implications which I don't know yet: what if a user does not want this allowed, and what if perhaps it's only necessary at installation? What if for example a parent wants to protect his kid and himself from installing all sorts of FF-addons, for security reasons or because it may cost a fortune?



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?



Edited 1 time(s). Last edit at 10/06/2015 08:45AM by siria.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: October 06, 2015 10:28AM

Fine!

Night is for sleeping - and siria is for finding our stupid mistakes and solutions!

Sending works now!

And here goes the final working 7z-package!

Attachments: quicknote75.7z (137.3 KB)  
Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 06, 2015 02:27PM

Very glad that you, siria and rodocop, got it figured out.

siria
What is/are the pref(s) that allow installing addons and extensions?
Do they need to remain 'true' in order for item to work, or do they need to be 'true' only for the install?

Quote
siria
First, to my embarassment, had the necessary km-firefox-pref typed
false, with "addons" instead of "extensions" in the name!! No wonder
no addons worked so far on my machine, although mysteriously on
yours... Arrgh!! But at least there's hope now other addons will
start working too.


Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 06, 2015 02:44PM

Quote
rodocop
I tried to force encoding in View Note-file macro by adding red line:

_Note4me_View {
$_Note4me_ViewPath=getpref(STRING,"k-meleon_Note4me.FPath");
opentab("file:///".$_Note4me_ViewPath);
forcecharset(UTF-8);
}

I think the line of code that you added is in the current window/tab and not in the new one where the file is displayed. A macro only runs in the place from which it started.

I work in English and ascii so character sets are not something with which I normally work. I will have to research some.

If you set some text into 'note4me.txt' and then just open and view the file without K-Meleon, do you see the correct alphabet and characters?

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 06, 2015 03:00PM

rodocop

Why do you need to force UTF-8? If I add a string of text that is UTF-8 then the file is UTF-8.

Quote
note4me.txt
2015-10-06 10:49
https://www.bing.com/translator/
Я пытался заставить кодирования в Примечание файл макросов путем добавления красная линия:

Am I missing the point about something?

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: rodocop
Date: October 06, 2015 03:20PM

File is UTF-8, but KM opens txt (may be at my specific system) as Win-1251 (PageInfo shows that page is rendered in Quirks mode) and I need to change encoding manually.

Default text editor (notepad) opens it right.

I understand that most systems would handle it without glitches, so my task here is to learn how to force encoding for new page opened. If possible.

I'm just curious.



Edited 2 time(s). Last edit at 10/06/2015 03:22PM by rodocop.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 06, 2015 06:12PM

Maybe I see it now. You and I are using different methods to view the text file. Your code is using KM to view the file and the code that I use calls notepad.exe [ or whatever alternate program ] is my system default for opening files with the extension 'txt'.

If Notepad displays the file as UTF-8 without the quirks, then you might try my method. Let me know if this works.

.
.
_Note4me_FileNotFound{
alert(sub("%s",$acfg_File,_("The file %s could not be found.")),_(Note4me),EXCLAIM);
}

Note4me_View {
$__path=$_Note4me_File_Path;
$__data=readfile($__path);
if ($__data=="") {&_Note4me_FileNotFound;
 } else {
 $ext="txt"; &getSecureExtensionHandler;
 exec(sub("%1",$__path,$cmdline));
 }
}
.
.


Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: siria
Date: October 06, 2015 06:47PM

Can replicate that encoding thing on KM1.6 smiling smiley

=> it's the file itself. UTF-8 exists with or without "BOM", as notepad++ calls it. That is some sort of hidden special character in the very beginning of the file. When I save the cyrillic text as utf8 "without", then KM shows gibberish, and if saved "with", it displays fine. Had the same prob with another text editor some time ago :-)
Some editors are just more intelligent than others...

James, unlike rodocop, guenter, dorian, adodupan, naruman and a few others I have no clue about installing addons yet, that's exactly the prob!
My only few bits of knowledge are so far:
pref "kmeleon.install_firefox_extension" is necessary that NEW xpi-FF-addons think KM were a Firefox, otherwise they claim in about:addons to be "incompatible with KM75". Sounded like sort of faking the KM UA to fool the addon-install-process, provided I read that right... :cool: And they said this pref also makes changes in install.rdf unnecessary.
On the other hand there are (very few) genuine "KM-addons", adodupan had created one awhile ago, and THOSE need that same pref to be FALSE!
Guess each addon-macro should include a little check if it's in first run or not, and depending on that should change this pref itself at first run. And afterwards perhaps reset it back how it was before.
Assuming that it's only necessary for installation, but haven't tested yet.

Another addon-pref is native Mozilla: "xpinstall.enabled"
That doesn't seem to mean much, only to prevent accidental xpi-installations when unknowingly clicking on an xpi-link, but then again, have read that would pop up a confirmation anyway? Would need some testing in KM itself. The web says local installs would work regardless of that setting, and once an addon is installed it doesn't matter anymore. There exists a whitelist for sites like mozilla-archive that work even if that pref is False.

Installed addons seem to be stored as list in one of the "extensions" prefs in about:config, otherwise the browser probably wouldn't know if it's first run or not... but haven't tested that stuff yet either...

Hmm... what else...
The xpi (and jar?) doesn't seem to work if a dll is included in a zipped "plugin" folder. But that folder can simply be placed outside, either in browser/extensions/plugins or in browser/plugins... but this is all more half-knowledge as certain from me at this point yet.

To change page encoding in a new tab:
Try if $OnLoadOnce helps? After the opentab-line insert:
$OnLoadOnce=$OnLoadOnce."somemacroname;" ;
You said you tried already with a separate macro to change charset, so that would be it.
The little catch is: this will be fired at the NEXT page load, which could just as well be another tab if several tabs are currently loading...



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?



Edited 3 time(s). Last edit at 10/08/2015 05:47PM by siria.

Options: ReplyQuote
Re: Quick Note extension for K-Meleon75.1?
Posted by: JamesD
Date: October 06, 2015 07:16PM

Quote
siria
pref "Kmeleon.install_firefox_extension" is necessary that NEW xpi-FF-addons think KM were a Firefox, otherwise they claim in about:addons to be "incompatible with KM75". Sounded like sort of faking the KM UA to fool the addon-install-process, provided I read that right...

That pref does not exist on my system. I guess that explains why I was of little help.

For extensions with 'xpi' parts coming from a 7z file, could I assume that the extraction would happen with KM not running? I, myself, never install into a running KM.

If one were to assume that a user extracting from a 7z file, did want the extension to fully install, then I think I could force the pref. I know that I can if it does not already exist. I am not sure what can be done if the pref already exists and is false.

Now I go and test. Well, sometime. Right now I must go and do maintenance on my lawn mower.

Options: ReplyQuote
Re: Quick Note / HowTo xpi-addons in KM75?
Posted by: siria
Date: October 06, 2015 08:25PM

Uh oh... *finally* did some testing now with that xpi-stuff, trying to figure out a convenient way to check and enable that pref at first run, by the kmm-file (Pref "kmeleon.install_firefox_extension", and no, Dorian has not included it yet by default)

==> Could it be that this pref must be TRUE at EVERY startup, otherwise already installed addons will get disabled?? :O At least that happens on my Vista box. When toggling the pref during session, about:addons will immediately say "..is incompatible with KM", and at next start the addon is actually disabled!
==> Is there any trick? Or does that mean that genuine FF-addons and genuine KM-addons cannot both be active in the same session?



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?



Edited 1 time(s). Last edit at 10/06/2015 08:28PM by siria.

Options: ReplyQuote
Re: Quick Note / HowTo xpi-addons in KM75?
Posted by: rodocop
Date: October 06, 2015 10:50PM

James,
it's very strange you don't have this pref as it was exactly you who created xpinstallext.kmm :O
Like shоemaker without shоes grinning smiley

(By the way, you macro to open Note4me-file in text editor works fine. Thank you!)

Options: ReplyQuote
Re: Quick Note / HowTo xpi-addons in KM75?
Posted by: siria
Date: October 06, 2015 10:58PM

PS: am currently rewriting the macro, update will follow...



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?

Options: ReplyQuote
Re: Quick Note / HowTo xpi-addons in KM75?
Posted by: rodocop
Date: October 06, 2015 10:58PM

siria,
I'll try your method tomorrow.

And speaking about xpi-installation: I tried adodupan's restart-addon made for KM not FF. As I can recall, I was to change kmeleon.install_firefox_extension to false only for the time of installing that KM-addon.

Than I switch it back to true in order to get working FF-addons and cRestart stayed working too.
But I can be wrong with my memory so I should test it again to say precisely.

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


K-Meleon forum is powered by Phorum.