Announcements :  K-Meleon Forum
 
Pages: Previous123
Current Page: 3 of 3
Re: K-Meleon 76 Beta
Posted by: JamesD
Date: November 15, 2015 08:36PM

Quote
siria
I'm using Notepad++, but the font can't be culprit. When adding exotic text into the same file with "appendfile" it looks correct. Only snippets added by iniwrite are wrong.

I have discovered a problem using Notepad++ for encoding an ini file as UTF-8. It cannot do that. I made a file ini style with encoding set to UTF-8. When I save the file as some_name.ini and select 'all types' the resulting file is ANSI.

I finally succeeded using Notepad. The file is UTF-8-BOM.

I am working on a system to help every macro writer quickly start working with an ini file that is UTF-8. It will be a function.

I was here trying to find out how to spell 'cyrillic' when I saw your post. I need another hour or so to finish and test.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: Dorian
Date: November 15, 2015 09:36PM

For iniwrite maybe it works with utf-16 only. Can iniread read utf-8 correctly?

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 15, 2015 10:41PM

have tested, with chinese KM-readme, on Vista:

- iniwrite creates new files always as ANSI, regardless which text is copied.
The chinese characters are all written "???"
==> iniread reads "???"

- creating files first with Notepad++ OR with vista-notepad in UTF8:
==> same as ANSI: "???"

- copying chinese text via clipboard and Notepad directly into those UTF8 files:
==> iniread reads characters very unhealthy looking, definitely wrong ;-)

- creating files first with vista-notepad in "unicode":
==> Notepad++ identifies this as "UCS-2 Little Endian"
==> THIS WORKS! reading+writing

PS: found in my notes from a few weeks ago that "appendfile" ONLY writes UTF-8. Which creates wrong characters too if the existing file is in ANSI. But may have to test this again.


(sig) Brandnew K-Meleon 77 in development now!
(based on Goanna engine, own subforum, try TEST BUILDs)
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: K-Meleon 76 Beta
Posted by: JamesD
Date: November 15, 2015 10:41PM

Quote
Dorian
For iniwrite maybe it works with utf-16 only. Can iniread read utf-8 correctly?

How does one make a file as UTF-16? Notepad++ would not make file. I finally used Notepad.

My system created a new ini file UTF8, but using iniwrite did not send correct words to the file. Lines 1 and two existed in a UTF-8-BOM file. Macro with iniwrite wrote cyrillic to file as the next two lines.

The file remains as UTF-8-BOM. The file has List in []'s as line 3 but that does not show here. I have no idea why.


[IniMode]
Encoding=utf-8
    Russian=?????????? ? ?????????



Edited 2 time(s). Last edit at 11/15/2015 10:44PM by JamesD.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 15, 2015 11:16PM

Just a little test-macro for ini + appendfile, it appears on top of Edit-menu:

http://kmeleonbrowser.org/forum/file.php?9,file=1332,filename=test_iniwrite.kmm

PS James:
When posting code it helps to check "disable BBcode for this message" and perhaps also "disable smileys for this message". Can be found right below the title. Have overlooked it for years too - and right now at this moment I discover there's also a checkbox for sig lines grinning smiley

Edit: Path-correction in macro. I shouldn't make last minute changing without testing, no matter how simple (sigh).



Edited 2 time(s). Last edit at 11/16/2015 10:50AM by siria.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: JamesD
Date: November 16, 2015 09:07AM

I finally got an ini file to accept a string in UTF-8. As Dorian pointed out the ini file must already be UTF-8 for the iniwrite to work correctly.

I have file in locales named Tword.txt which has some Russian text. I have a file in macros which is an ini encoded in UTF-8. The trick is to always copy,and use the ini model in macros as the existing ini file to which you would write UTF-8 strings.

The model file - uniis8.ini

[code]
[IniMode]
Encoding=utf-8
[/code]

My test string file - root\locales\Tword.txt

[code]
Знакомство с браузером
[/code]

My output ini file in my profile - MyNewFile.ini

[code]
[IniMode]
Encoding=utf-8
[List]
Russian=Знакомство с браузером
[/code]

My macro and the files to run the test are here:

https://dl.dropboxusercontent.com/u/1522294/ini_eight.7z

The macro, Makeini8, can be called from your code. The variable, $_I8path, must be provided.

[code]
Makeini8 {
$__Cpath = getfolder(MacroFolder)."\\iniis8.ini";
$__result = copyfile($__Cpath, $_I8path);
$__result ? logmsg($_I8path, warning) : alert("failed", "makini8", EXCLAIM);
}
[/code]


[b]ini_eight.kmm[/b]

[code]
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
# File name: ini_eight.kmm
# ---------- Demo writing to an ini file using UTF-8 encoding
# ----------
# ---------- Requirements - main.kmm
# ---------- JamesD Version 1.4 2015-11-16

Makeini8 {
$__Cpath = getfolder(MacroFolder)."\\iniis8.ini";
$__result = copyfile($__Cpath, $_I8path);
$__result ? logmsg($_I8path, warning) : alert("failed", "makini8", EXCLAIM);
}

_ini_eight_run_demo {
macroinfo="Demonstrate how to make an ini file encoded as UTF-8";
# Obtain words using cyrillic spelling
$_ini_eight_cyfile = readfile(getfolder(RootFolder)."\\locales\\tword.txt");
alert($_ini_eight_cyfile, "cyrillic", INFO);
# Create an ini file with encoding as utf-8
## Set the path to new file required
$_I8path = getfolder(ProfileFolder)."\\MyNewFile.ini";
## call the macro
&Makeini8 ;
iniwrite("List", "Russian", $_ini_eight_cyfile, $_I8path) ;
alert($_I8path . "\n as 'List', 'Russian'", $_ini_eight_cyfile, INFO);
$_newValue = iniread("List", "Russian", $__ini_Value, $_I8path);
alert($_newValue, $_ini_eight_cyfile, INFO);
}

_ini_eight_BuildMenu {
setmenu("&Tools",macro, "UTF-8 ini Demo", _ini_eight_run_demo, Misc);
}

## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$OnInit=$OnInit."_ini_eight_BuildMenu;";
$macroModules=$macroModules."ini_eight;";
[/code]

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 16, 2015 11:42AM

Meanwhile noticed my little testmacro above had a glitch, the path was empty. Argh - again one of those last-minute changes which seem too simple to test again...

After testing it with KM1.6 on vista, it looks like iniwrite has always encoded in utf-16 only.

@Dorian: can we get some encoding options in macrolanguage, for creating and changing?
A quick search for commandline options for notepad sounds like there exists a switch, but they say it wouldn't work. Are there any other ways that don't require user actions...?
Or alternatively include litte empty encoded files as template, which could be copied by appendfile etc...

James, no time to test yours until evening (the hassle with my 2 computers), but from reading it sounds like ini-writing into an existing utf8-file works in Win7?? On Vista no chance. And your template really is "UTF-8", not accidentally "unicode/utf16/little endian"?


(sig) Brandnew K-Meleon 77 in development now!
(based on Goanna engine, own subforum, try TEST BUILDs)
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: K-Meleon 76 Beta
Posted by: JamesD
Date: November 16, 2015 12:39PM

Dorian

I have gotten the update 2 installed and first thing that I have checked is the passwords. Mine are in the json file and the ones set as 'rejected site' still ask if I want to save the password each time that I log into those sites.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: JamesD
Date: November 16, 2015 12:54PM

Quote
siria
James, no time to test yours until evening (the hassle with my 2 computers), but from reading it sounds like ini-writing into an existing utf8-file works in Win7?? On Vista no chance. And your template really is "UTF-8", not accidentally "unicode/utf16/little endian"?

I tried so many combinations that I had to go back and check to how the files were encoded.

Tword.txt is UTF-8 BOM
iniis8.ini is UCS-2 LE BOM

This might just be one unique time that it works. I get confused anytime the encoding is not ANSI.

Any chance that UCS-2 LE BOM is "unicode/utf16/little endian"?

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: hermes
Date: November 16, 2015 12:59PM

Favicon crash report (updated for KM76bu2): "Submission suceedded with the number 2066".
https://yadi.sk/d/ZHk7piFLkVSH9

Systems: Server 2003 SP2 Datacenter, 7 SP1 Ultimate (x86).
...
Duplicate (http://kmeleonbrowser.org/forum/read.php?3,60195,136372,page=4#msg-136372)


Thanks Dorian, KOI8 encoding works and switches great!
...
Checked really need to replace only kernel32.dll (from SP3)
and KMELEON is working steadily in XP SP2 : )

In this version also fixes crash on pages on css3 with
repeated minimise and maximise the window, thank you!
...
Noticed a crash when you try to pass a reference
in an external download manager (e.g. Orbit Downloader)
unfortunately crash report plugin not generates a report
falling along with the program.

By the way crash report plugin often does not generate
reports (plugin crashes with browser).

Using Sysinternals tools has shown that the culprit file
secur32.dll. However, without it, the transmission links
(automatically) not possible. Replacing file from another
OS version has no effect as renaming. These actions lead
to inability of the transfer operation. Glitch noticed in
the entire family of windows server 2008 service pack
doesn't matter. The browser then begins to fall immediately,
while the system will not reboot.

Problems with saving pages in the format with images
(Web page, complete). Is expressed: browser saves empty
folders without pictures (sometimes with clean sub-folders)
and without page is html. Example, http://www.free-codecs.com/
or http://codecs.com/ . Try to save "Web page, complete".
Never happened since 74+. Other browsers save without problems.

And about save please tell me it is possible to add the save
the page in TXT format as in seamonkey / firefox ? Often can
find pages consisting of frames and text on them is displayed
only by scripts. That is, retaining such page in HTML and opened
offline, you'll get a blank screen and TXT at least saved text.
Often found on forums and conferences, for example, there are
required scripts:
http://forum.ixbt.com/topic.cgi?id=4:128497 or any conference ixbt.
This is just an example.

At the end please can tell me how can I use a new built-in adblock,
or is he still an experimental and not working?
Previously used adapted extension and everything was obviously.



Edited 4 time(s). Last edit at 11/16/2015 05:35PM by hermes.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: JamesD
Date: November 16, 2015 06:21PM

Quote
hermes
At the end please can tell me how can I use a new built-in adblock,
or is he still an experimental and not working?
Previously used adapted extension and everything was obviously.

I wrote a macro to control this dll. It is in the last post of this thread.

http://kmeleonbrowser.org/forum/read.php?9,135175

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 16, 2015 10:01PM

Quote
JamesD
chance that UCS-2 LE BOM is "unicode/utf16/little endian"?

Yeah. As I wrote above:
Quote
siria
creating files first with vista-notepad in "unicode":
==> Notepad++ identifies this as "UCS-2 Little Endian"
==> THIS WORKS! reading+writing

And when I looked that up in the web it turned out another name is UTF-16, as Dorian already suspected.
Perhaps we don't necessarily need to write in UTF-8, but one way or another iniwrite should be able to write exotic text into self-created files.
PS: appendfile writes fine into both, UTF-8+16


(sig) Brandnew K-Meleon 77 in development now!
(based on Goanna engine, own subforum, try TEST BUILDs)
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: K-Meleon 76 Beta
Posted by: Seba-lox
Date: November 17, 2015 10:07AM
Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: hermes
Date: November 17, 2015 02:50PM

Quote
JamesD

I wrote a macro to control this dll. It is in the last post of this thread.

http://kmeleonbrowser.org/forum/read.php?9,135175

Thank you, i will try : )



Edited 1 time(s). Last edit at 11/17/2015 02:51PM by hermes.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 18, 2015 12:04AM

@Dorian
Currently have the prob again that a macro just won't work without a tiny break in between. Needed alert boxes as workaround in the past, but too annoying. Remembered now the new "settimer" function smiling smiley
It does work fine, a LOT more convenient than popups, but 1 sec can be amazingly looong... Especially if only a split-second would be needed. Have tried by pure JS and settimeout-500ms, that's better, but it needs toggling JS on sad smiley
Please change "settimer" to 1 = 1/100 sec?

Hmm, then again... grmpf. Thought there are no macros out there yet which use it, but forgot that 75.X already have that 1sec build in, for all future macros too sad smiley
The again... my own macros are cross-version and check the platform.ini for it, they could adapt...



Edited 1 time(s). Last edit at 11/18/2015 12:12AM by siria.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: JamesD
Date: November 18, 2015 02:45AM

Quote
siria
Thought there are no macros out there yet which use it

BackGnds uses settimer.

http://kmeleonbrowser.org/forum/read.php?10,96991,135663#msg-135663

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: Dorian
Date: November 18, 2015 09:12PM

Quote
hermes

Problems with saving pages in the format with images
(Web page, complete). Is expressed: browser saves empty
folders without pictures (sometimes with clean sub-folders)
and without page is html.

Will be fixed in next full update (requires patched xul.dll)

Quote
hermes
And about save please tell me it is possible to add the save
the page in TXT format as in seamonkey / firefox ?

Should be easy.

Quote
JamesD
I have gotten the update 2 installed and first thing that I have checked is the passwords. Mine are in the json file and the ones set as 'rejected site' still ask if I want to save the password each time that I log into those sites.

Yes, need patched omni.ja. Should be fixed when I release a new one.

Quote
JamesD
PS: found in my notes from a few weeks ago that "appendfile" ONLY writes UTF-8. Which creates wrong characters too if the existing file is in ANSI. But may have to test this again.

readfile, appendfile and writefile only work with utf-8.


Quote
siria
@Dorian
Currently have the prob again that a macro just won't work without a tiny break in between.

What kind of macro?
But I understand that sometimes you may need to wait for kmeleon to do its stuff in a middle of a macro. settimer can be used as a workaround, but something more practical should be done. I can always add a setµtimer if I don't have a better solution.



Edited 1 time(s). Last edit at 11/18/2015 09:18PM by Dorian.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: JamesD
Date: November 18, 2015 09:28PM

Quote
Dorian
readfile, appendfile and writefile only work with utf-8.

That is great! Looks like the iniwrite is the only one for which we need a fix. I have a work-a-round but we really need a code fix. However, I think you said the api or function or something wrote encoding only as the ini file already exists. Some way to trick it into thinking 'new' is UTF-16, maybe?

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 18, 2015 09:39PM

Not really that great if for example you want to append text to an existing ANSI file cool smiley

Yes a millitimer would be nice! (although it'll take awhile until I stop trying to keep macros cross-version, but the time will come ;-)



Edited 1 time(s). Last edit at 11/19/2015 06:15PM by siria.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 18, 2015 10:08PM

Tested a bit again with appendfile writing into existing ANSI, UTF8, UTF16 files.
Had thought that it could also write into utf16, but now see that was an error, in direct comparison those utf8 and utf16 chinese signs do look different cool smiley
Thinking... could it also write or create kmm files in macros folder? Frankly that would be rather scary...

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 18, 2015 11:13PM

PS: current millitimer case is to scroll by injectJS after session(Undo).
No prob in 1.5-1.6
In 74 it only works if JS is already enabled and the Undo-Button isn't pressed to quickly...
Since 75 it doesn't seem to work anymore at all, JS on or off, except after a little break.
Have now finally tested in 76 upd2 too, and still the same there. Of course, in upd2 scrolling isn't necessary anymore, but possibly other injected codes may need that split second break too.
Just as millitimer example ;-)



Edited 1 time(s). Last edit at 11/19/2015 06:17PM by siria.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: hermes
Date: November 19, 2015 02:44PM

Special for WindowsXP SP2 users (for others can be fun).
For working need a replacement (requires from v.76+)
KERNEL32.DLL from SP3. But this requires booting from
other OS or other boot-device. I wrote small install
script, which save from this. May be useful.
...
Necessary create blank text file and rename as *.inf
(as example: SETUP.inf).
...
Copy this text in file:


[Version]
Signature=$Chicago$

[DefaultInstall]
Copyfiles=COPY
AddReg=ReG

[COPY]
KeRNeL32.DLL,,,8

[DestinationDirs]
ExampleCopyFiles=10,SySTeM32

[ReG]
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SFC","ProgramFilesDir",,"\"


Save it and press right mouse button on this file, select "Install".
Reboot is require. Script replace old dll if SP3 dll lies next
(in the same folder with script).
...
If you are unsure of your actions, do not use this.



Edited 1 time(s). Last edit at 11/19/2015 02:47PM by hermes.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: hermes
Date: November 19, 2015 03:50PM

Quote
Dorian
Quote
hermes

Problems with saving pages in the format with images
(Web page, complete). Is expressed: browser saves empty
folders without pictures (sometimes with clean sub-folders)
and without page is html.

Will be fixed in next full update (requires patched xul.dll)

Quote
hermes
And about save please tell me it is possible to add the save
the page in TXT format as in seamonkey / firefox ?

Should be easy.


: ) thanks!


Necessary little changes in docinfo.kmm:
(initially)
<html><head><title>

(after)
<html><head><meta charset=utf-8><title>

Or not a possible create right conclusion
to display symbols in title of links after
auto generate links page (or images page).
...
if the language of text in title of links
does not use Latin characters.


I noticed that xpi installation not work anymore : (
if i try install after setup:

"kmeleon.install_firefox_extension" as "true"

and when i try open (in offline as file / open)
xpi file, at first nothing happened... Then there
is a supplement indicator download from network
and so continues infinitely (on about:addons).
...
it works in 75.1 but not works now. XPi the same.

I had to do as on old metod: dismantling extension manually.
Plus what happened.

Quote
JamesD
I wrote a macro to control this dll. It is in the last post of this thread.

http://kmeleonbrowser.org/forum/read.php?9,135175

After little changes in interface of script it turned
out an excellent replacement for the original Adblock
(i little simplified menu) and thanks Dorian for himself
dll plugin.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: hermes
Date: November 19, 2015 05:21PM

Noticed problems with frames.

Pref. browser.frames.enabled
ignored by browser as and
Privacy \ Block Page Colors.



Edited 1 time(s). Last edit at 11/19/2015 05:28PM by hermes.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: Dorian
Date: November 19, 2015 06:29PM

Quote
hermes
Pref. browser.frames.enabled
ignored by browser

This pref was removed

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: hermes
Date: November 20, 2015 10:16AM

Quote
Dorian
Quote
hermes
Pref. browser.frames.enabled
ignored by browser

This pref was removed

Do i understand correctly that now will impossible
lock frames through variables?

There are sites (usually it hosting images for forums
and similar) where it is simply catastrophic. Adblock
does not always save (even if write special rules
for ad networks it help an average no more on three days).
...
But suppose necessary to move with disconnected CSS on
a general website, for example, that not need to open
a couple of dozen Spoilers that are already loaded,
but are hidden across styles until you press on them via
JavaScript (onclick event).

I use modified disablecss.kmm, but it works only on one page.
...
This is a feasible? For example as in seamonkey / firefox in
a view menu (with styles or without). At the level of variable(s)?



Edited 1 time(s). Last edit at 11/20/2015 10:32AM by hermes.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: siria
Date: November 20, 2015 11:22AM

@hermes
There are native prefs for global loading of css and subdocuments and other interesting stuff, I also learned this only recently and was very surprised! The result were my recent macros for toggling global settings: permdefs, priv3buttons, blockeria.

Absolutely great is extension ExExPermissions/ExExceptions, which allows to finetune permission exceptions by site! Only prob is that it's slightly outdated, guess there are more types available now.

And Dorian added in KM75.0 a new addperm-command, assume that customizes the same file "permissions.sqlite" in the profile, but haven't gotten around yet to examine that closer.

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: hermes
Date: November 20, 2015 03:50PM

Began to study smiling smiley

Options: ReplyQuote
Re: K-Meleon 76 Beta
Posted by: hermes
Date: November 21, 2015 12:32AM

Crash with URLs using non-Latin characters:
for example, if address is made up of
pure cyrillics (more info: https://en.wikipedia.org/wiki/.%D1%80%D1%84).
myself not happy with this initiative,
but forced to use them.

If type cyrillic address in address bar and
use ID_NAV_GO get error: address not found.
In this case, address will be garbled.

Need to enter again...
If highlight and hit enter then transition
will happen. But too early to rejoice. If refresh
this page using ID_NAV_FORCE_RELOAD or send
ID_NAV_GO the browser will fall. Sometimes
not a first time. But on second or third this
inevitably. ID_NAV_RELOAD last longer often up
to ten times. However, any other command can
cause to fall. For example, closure of this page.
...
I think this is due to use of ansi when working
with addresses.

Failed prepare a crash report because plugin
unfortunately falls with browser sad smiley
...
With seamonkey / firefox this fully works. It would
be wonderful if this worked in favorite browser.



Edited 3 time(s). Last edit at 11/21/2015 12:48AM by hermes.

Options: ReplyQuote
Pages: Previous123
Current Page: 3 of 3


K-Meleon forum is powered by Phorum.