General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Pages: Previous123Next
Current Page: 2 of 3
Re: kma service (experimental)
Posted by: disrupted
Date: May 19, 2009 04:09PM

yes.. i totally agree.. bottom right is a much better place.. i did that with displayip but there's one problem.. when i simulated smaller or bigger screens or resolutions different than mine(17" 768 x 1024); on smaller displays ..part of the window was not visible while on bigger it was not at the far right and bottom as it should. it should be done by getting screen width and height with something like that:
$h=@DesktopHeight
$w=@DesktopWidth
and then the coordinates for where to place the window bar are calculated according to those values.. i'm still exploring that but for now the best way to ensure the script gui will be visible in same place on all monitors and resolutions is centre (-1, -1) let's autoit automatically find the centre or top left which will always be the same regardless of resolution.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: barzel
Date: May 20, 2009 09:10AM

Don't mean to beat a dead horse here but, just out of curiosity, I tried to find some acceptable values for my 1024 x 768 screen to make the window show bottom right without overlapping any scrollbar eventually present. Then I tried changing resolution (from 640 x 480 to 1600 x 1200) and the window keeps displaying in almost the same position.
It surely seems to simple to be true but who knows, maybe it really works.

$hold = GUICreate("make kma", 184, 28, (@DesktopWidth-220), (@DesktopHeight-110), BitOR($WS_DLGFRAME, $WS_POPUP, $WS_EX_TOPMOST))

Some testing on other sytem/screen/resolution would be definitely welcome.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: disrupted
Date: May 20, 2009 04:31PM

yes, this seems to work.. and i think it should work on those widescreen displays as well. i'll see if i can use it on displayip..(grr more coding grinning smiley)

Options: ReplyQuote
Re: kma service (experimental)
Posted by: barzel
Date: May 21, 2009 09:40AM

Glad to be of help!smiling smiley
Btw, tried your updated displayIP and it shows up correctly at various resolutions. Nice work!grinning smiley

Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 20, 2009 12:01PM

Hi disrupted,

I have tested a nice way to save complete page (with images,...) in a single file, it's called PHF, and it can be found here :

http://www.greywyvern.com/code/php/phf-demo

The advantage, is there is nothing to install to read theses files, and can be read from any Browsers, except incompletely by IE which don't handle data:

But there is the need of a server, what is ennoying. So I have read the thread

http://my.opera.com/community/forums/topic.dml?id=169593

where a javascript version without server needed is online and discuss, but it's write for Opera.

Unfortunately, I don't know about java and the way to adapt and call it from windows, and I'm not sure if it's possible.

I you have an idea about it ...

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc





Edited 1 time(s). Last edit at 07/20/2009 12:04PM by JujuLand.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: desga2
Date: July 20, 2009 01:09PM

Quote
JujuLand
But there is the need of a server, what is ennoying. So I have read the thread

http://my.opera.com/community/forums/topic.dml?id=169593

where a javascript version without server needed is online and discuss, but it's write for Opera.

Unfortunately, I don't know about java and the way to adapt and call it from windows, and I'm not sure if it's possible.

If you have an idea about it ...

A+

Do you like runing the JS code from windows or from K-Meleon?

I read that in Opera use this code for a button to use the JS code:
opera:/button/Go%20to%20page,%22javascriptsad smileyfunction()%7Bopera.convert2PHF()%7D)()%22,%22PHF%22,%22Save%20to%20PHF%22,%22Save%20document%22

K-Meleon in Spanish

Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 20, 2009 02:15PM

From K-Meleon, obviously :s smiling smiley

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc





Edited 1 time(s). Last edit at 07/20/2009 02:19PM by JujuLand.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: desga2
Date: July 20, 2009 02:57PM

The idea for the macro is the next:

- Create a macro file with code: (pseudocode)

Convert2PHF{
$_JS_code=readfile($_pathfile."\\Convert2PHF.js");
injectJS($_JS_code);
open("javascript: (function(){opera.convert2PHF()})()");
}

_Build_Menu{
# Create a menu entry in File -> Save as PHF, to call Convert2PHF macro
}

_Build_Toolbar{
# Create a toolbar button to call Convert2PHF macro
}

K-Meleon in Spanish



Edited 3 time(s). Last edit at 07/20/2009 03:00PM by desga2.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 20, 2009 04:43PM

ok thanks

I'll try

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 20, 2009 08:06PM

I have tried this :

Convert2PHF{
$_JS_code=readfile(getfolder(root)."\\Tools\\322_convert2phf.js");
injectJS($_JS_code);
open("javascript: (function(){opera.convert2PHF('".$URL."')})()");
}

and I have this error (look at joined file)

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Attachments: PHF_error.png (19.8 KB)  
Options: ReplyQuote
Re: kma service (experimental)
Posted by: desga2
Date: July 20, 2009 08:33PM

Try this;
Convert2PHF{
$_JS_code=readfile(getfolder(root)."\\Tools\\322_convert2phf.js");
injectJS($_JS_code);
open("javascript: (function(){opera.convert2PHF()})()");
}

Without ".$URL.".

Or is possible that the problem is that JS code is a multiline file.
Try to modify the JS file with code to a file in a only one line changed CR (new lines) by semicolons ;

K-Meleon in Spanish



Edited 1 time(s). Last edit at 07/20/2009 08:36PM by desga2.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 20, 2009 09:11PM

It seems effectively that there is no need of $URL, but

Opera non defined error is always here, and if I remove opera., I have then the error convert2PHF not defined

In the two case, I have the error about security, but a bit different if no $URL inserted.

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Attachments: PHF_error.png (16.2 KB)  
Options: ReplyQuote
Re: kma service (experimental)
Posted by: disrupted
Date: July 20, 2009 11:52PM

i'm not very good with js but i know its very tricky..using either inject or open js..and for some odd reason, some js do not work with inject js after readfile and work only with openjs.. openjs is better to place all the js code with in and not just the function and getting it from read; it can be nightmarish though because it's inside the macro and one single mistake can make all the macro go haywire..it's very unforgiving.

i'll play with this script, it appears to be the type that prefers open js.. it will require some code changing to work with kmeleon; similar to ff extensions..there might be a command specific to the browser and kmeleon will not like..also all double quotes " in the script will need to be replaced with single quote ' .. this doesn't affect the script in anyway but to kmeleon " will interpret as internal macro and mess up both the script and the macro.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: disrupted
Date: July 21, 2009 04:24AM

i can't make it work either..security error thingy but not complaining about bad js code..where is it supposed to save the file? did oyou test in opera..i think it should first trigger a filesave dialog

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ----------save as phf archive:test


phfsave{
open("javascript: (function(){ var reloadImage = function(src) { var f = document.createElement('iframe'); f.src = src; f.width = 0; f.height = 0; f.frameBorder = 'no'; f.scrolling = 'no'; f.onload = function(){ this.parentNode.removeChild(this); }; document.documentElement.appendChild(f); }; var i=0;var img;var d=document;var r=d.documentElement;var h=r.getElementsByTagName('HEAD')[0]||r.insertBefore(d.createElement('HEAD'),r.firstChild); var imgcache=[];var domain=location.protocol+'//'+location.host+(location.port!=''?':'+location.port:'');var ca=d.createElement('canvas');d.body.appendChild(ca);while (img=d.images[i++]) if (img.src) if (domain==img.src.substring(0,domain.length)) {if (!imgcache[img.src]) {ca.width=img.offsetWidth;ca.height=img.offsetHeight;var c=ca.getContext('2d');var tc='transparent';var n=img;while((tc=='transparent')&&(n=n.parentNode)&&(n!=d)) tc=getComputedStyle(n).backgroundColor; c.fillStyle=tc; c.globalAlpha=1; c.fillRect(0,0,img.width,img.height); var copyImg; copyImg=d.createElement('IMG') copyImg.style='position:absolute; display:block; top:-1000px; left:-1000px;'copyImg.src=img.src;d.body.appendChild(copyImg);c.globalAlpha=0;c.drawImage(img,0,0,copyImg.width,copyImg.height,0,0,ca.width,ca.height);imgcache[img.src]=img.src=ca.toDataURL();reloadImage(img.src);d.body.removeChild(copyImg);copyImg=null;}else img.src=imgcache[img.src];}; d.body.removeChild(ca); ca=null; var st; var l=document.styleSheets.length; for(;l>0;l--) {st=document.styleSheets[document.styleSheets.length-1]; var sto=st.ownerNode; if(!sto.hasAttribute('TYPE')||sto.type=='text/css') if(!sto.hasAttribute('REL')||sto.rel=='stylesheet') { var j=0; var rule; while (rule=st.cssRules[j++]) { var s=document.createElement('STYLE'); s.text=rule.cssText; s.media=sto.media||'screen,print,presentation'; r.insertBefore(s,r.firstChild);// h.insertBefore(s,h.firstChild); }}; sto.parentNode.removeChild(sto);}; i=0; var script; var t; while (script=d.scripts[i++]) if (script.hasAttribute('src')) {t=script.text;script.removeAttribute('src');script.innerText=t;}; h.appendChild(d.createElement('META')).outerHTML='<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset='+d.charset+'' />'; // document.location='data:text/phf;charset='+d.charset+','+(boms[d.charset]||'')+encodeURIComponent(r.outerHTML)+'<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset='+d.charset+''>'; document.location='data:text/phf;charset='+d.charset+','+encodeURIComponent(r.outerHTML+'\n\n<!-- This document saved from '+document.location+' -->');})()");
}

phfphf_BuildMenu{
setmenu(OpenSave,macro,"Save As PHF",phfsave,-1);
}

$OnInit=$OnInit."phfphf_BuildMenu;";
# --------------------------------------------------------------------
$macroModules=$macroModules."saveasphf;"; 



Options: ReplyQuote
Re: kma service (experimental)
Posted by: Yogi
Date: July 21, 2009 06:39AM

Quote
disrupted
where is it supposed to save the file? did oyou test in opera..i think it should first trigger a filesave dialog

Yep, Opera's filesave dialog:


The file gets saved in the download folder opera is set to use.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: disrupted
Date: July 21, 2009 08:33AM

how about this one?
http://kmext.sf.net/macros/phfservice.kmm

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ----------save as phf archive:service

$savedir=getpref(STRING,"kmeleon.download.dir");
$pendphf=("page.phf.html");
$findthefucker=($savedir.$pendphf);
$_tool_path=getfolder(RootFolder)."\\Tools";


phfsave{
menugrayed=(hostname($URL)=="");
$phfservice=("httpeeeeeeeeee://www.greywyvern.com/code/php/phf?phf=");
$makephf=($phfservice.$URL);
$HOST = hostname( $URL );
open($makephf);
}


phfphf_BuildMenu{
setmenu(OpenSave,macro,"Save As PHF",phfsave,3);
}

$OnInit=$OnInit."phfphf_BuildMenu;";
# --------------------------------------------------------------------
$macroModules=$macroModules."saveasphf;";


Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 21, 2009 04:41PM

Well, it works, and it's easier than to break our teeth on the script, but we always go on green... server, and I'm not sure it can handle all the traffic.

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: kma service (experimental)
Posted by: disrupted
Date: July 21, 2009 09:48PM

hopefully their server is good.. i tested with very big pages like cbsnews and it's working ok.. the script in the first macro doesn't have errors but kmeleon doesn't like it and blocks it for security something so it needs further coding and needs a javascript guru like kko or lexi.. i don't want to fiddle with it too much because javascripting sometimes causes me mental instability

Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 22, 2009 05:48PM

Here is a small modif (more context menu entries), and the possibility to change the server + translation file :

savePHF.kmm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# Save the current page with PHF K-Meleon Forums by disrupted, JujuLand -------------------------------------------------
#
# Dependencies : none
# Resources : external phf server
# Preferences : extension.phf.server
#
# -------------------------------------------------------------------------------------------------

# Public -----------------------------------------------------------------------
$PHFserver="extension.phf.server";
$PHFdefault="http://www.greywyvern.com/code/php/phf?phf=";
$PHFservice=getpref(STRING,$PHFserver);
$PHFservice==""?setpref(STRING,$PHFserver,$PHFdefault) :0;
$PHFservice==""?$PHFservice=getpref(STRING,$PHFserver) :0;

# ------------------------------------------------------------------------------

phfsave{
menugrayed=(hostname($URL)==""?true: (substr($URL,0,6)=="about:"?true:false)) ;
#menugrayed=(substr($URL,0,7)=="chrome:"?true:false);
setclipboard($TITLE.".phf.html");
open($PHFservice.$URL);
}

phfserver{
macroinfo=_("Specify the PHF server URL");
$_tit=_("PHF server Configuration"); $_txt=_("Enter the PHF server URL:");
$_server=getpref(STRING,$PHFserver);
$_server=prompt($_txt,$_tit,$_server);
$_server==""?delpref(STRING,$PHFserver): setpref(STRING,$PHFserver,$_server);
}

phf_BuildMenu{
setmenu(OpenSave,macro,"Save page As P&HF ...",phfsave,3);
setmenu(DocumentSave,macro,"Save page As P&HF ...",phfsave,2);
setmenu(Misc,macro,"PHF &Server",phfserver,0);
setmenu(Misc,separator,1);
setaccel("CTRL SHIFT S","macros(phfsave)");
}

$OnInit=$OnInit."phf_BuildMenu;";
# --------------------------------------------------------------------
$macroModules=$macroModules."savePHF;";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

savePHF.kml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# LANGUAGE DEFINITION FILE


#--------------------------------------------------------
# Added by savePHF Extension (don't edit this comment)
#--------------------------------------------------------
Specify the PHF server URL=Spécifier l'adresse du serveur PHF
PHF server Configuration=Configuration du serveur PHF
Enter the PHF server URL:=Entrez l'adresse du serveur PHF:
Save page As P&HF ...=Enregistrer la page en P&HF ...
PHF &Server=&Serveur PHF
#--------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[edit]

added an accel "Ctrl Shift S"

modified the treatment of the URL server. If leaved empty, reset to greywyvern.com server.

Unfortunately, I thought have found the way in my first tests to change the default name with the real title of the page, but I was perhaps wrong, it doesn't modify the name of the generated file.

Also, disrupted,
I think that this doesn't work and isn't needed. Don't you think so ?

$pendphf=($TITLE.".phf.html");
$savedir=getpref(STRING,"kmeleon.download.dir");
$findthefucker=($savedir.$pendphf);

#menugrayed=(substr($URL,0,7)=="chrome:"?true:false);
not tested with chrome address, if we must block it (in all the test I have made, I have no menu bar avalaible)

[/edit]

[edit 2]

confirmed:

$pendphf=($TITLE.".phf.html");
$savedir=getpref(STRING,"kmeleon.download.dir");
$findthefucker=($savedir.$pendphf);
and
$HOST = hostname( $URL );

not needed, but I think use it another way :drool:

[/edit 2]


[edit 3]

Just add this in phfsave to give the possibility to change the name (paste)

setclipboard($TITLE.".phf.html");

[/edit 3]

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc





Edited 8 time(s). Last edit at 07/22/2009 09:05PM by JujuLand.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: disrupted
Date: July 22, 2009 11:51PM

thanks alain. yep..some parts are not needed atall..it was a pathetic attempt to makes utils rename the file after it has been saved.. first by checking if it exists and then ;sleeping' for a bit and checking again..it did work with a very bad symptom..the utils sleep made kmeleon stall ..so it was nasty..then i dropped that idea and decided to make auotit script check for the file and wait till its saved(case huge pages) and then rename..

cause unlike utils plugin; autoit is independent from kmeleon.. this worked perfectly fine..but to ensure no overwritting every happens.. autoit has to get page title..use it if available or host name and then append date and time.. it worked perfectly fine without any problems and then while testing with several pages; i found out that it doesn't always save the file as page.phf.html (ARGGGHHHHHH) in fact it only uses this with top-level domains only..but otherwise if an html or asp page is indeed saved..it will use their name..
so i spit at the computer and deleted all the 1 hour work from the macro but i guess i forgot that bit

i will use the new macro and update with your fr-FR locale and upload the package to kmext site..thanks again alain

- we now have 3 different archive saving types for km smiling smiley

- phf service uploaded to kmext page with french locale. filed under bookmarking and archiving



Edited 1 time(s). Last edit at 07/23/2009 02:26AM by disrupted.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: panzer
Date: July 23, 2009 07:50AM

Disrupted, what are cons and pros for each save format or are they all much the same?



Edited 1 time(s). Last edit at 07/23/2009 07:52AM by panzer.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 23, 2009 08:00AM

PHF is different from kma.

kma uses a zipper to save needed files, unzips it and opens the html file for display purpose.

PHF compress images, css, and probably other things and insert it in a single html. It can be opened with all the browsers, which don't need an extension to be able to read it (except IE which doesn't handle data: ), this is not the same for kma.

I have found some page which seem to block the process, exemple this page, but I don't know why.


A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc





Edited 1 time(s). Last edit at 07/23/2009 08:01AM by JujuLand.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: JujuLand
Date: July 23, 2009 10:03AM

A little improvement : you can now set collapse true (false by default) to compress the html (not very important)

PHPsave.kmm :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# Save the current page with PHF by disrupted, JujuLand -------------------------------------------------
#
# Dependencies : none
# Resources : external phf server
# Preferences : extension.phf.server, extension.phf.collapse
#
# -------------------------------------------------------------------------------------------------

# Public -----------------------------------------------------------------------
$PHFserver="extension.phf.server";
$PHFcompress="extension.phf.collapse";
$PHFdefault="http://www.greywyvern.com/code/php/phf";
$PHFservice=getpref(STRING,$PHFserver);
$PHFservice==""?setpref(STRING,$PHFserver,$PHFdefault):0;
$PHFservice==""?$PHFservice=getpref(STRING,$PHFserver):0;
$PHFcollapse=getpref(STRING,$PHFcompress);
$PHFcollapse==""?setpref(STRING,$PHFcompress,"false"):0;
$PHFcollapse==""?$PHFcollapse=getpref(STRING,$PHFcompress):0;

# ------------------------------------------------------------------------------

phfsave{
menugrayed=(hostname($URL)==""?true: (substr($URL,0,6)=="about:"?true:false)) ;
#menugrayed=(substr($URL,0,7)=="chrome:"?true:false);
setclipboard($TITLE.".phf.html");
open($PHFservice."&phf=".$URL."&collapse=".$PHFcollapse);
}

phfserver{
macroinfo=_("Specify the PHF server URL");
$_tit=_("PHF server Configuration"); $_txt=_("Enter the PHF server URL:");
$_server=getpref(STRING,$PHFserver);
$_server=prompt($_txt,$_tit,$_server);
$_server==""?delpref(STRING,$PHFserver): setpref(STRING,$PHFserver,$_server);
}

phfcollapse{
macroinfo=_("Compress the generated PHF file");
menuchecked=(getpref(STRING,$PHFcompress)=="true");
togglepref(STRING,$PHFcompress,"true","false");
$PHFcollapse=getpref(STRING,$PHFcompress);
}

phf_BuildMenu{
setmenu(OpenSave,macro,"Save page As P&HF ...",phfsave,3);
setmenu(DocumentSave,macro,"Save page As P&HF ...",phfsave,2);
setmenu(Misc,popup,"Portable &Hypertext Format",0)
setmenu(Misc,separator,1);
setmenu("Portable &Hypertext Format",macro,"PHF &Server",phfserver);
setmenu("Portable &Hypertext Format",macro,"&Compress HTML",phfcollapse);
setaccel("CTRL SHIFT S","macros(phfsave)");
}

$OnInit=$OnInit."phf_BuildMenu;";
# --------------------------------------------------------------------
$macroModules=$macroModules."savePHF;";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PHPsave.kml :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# LANGUAGE DEFINITION FILE


#--------------------------------------------------------
# Added by savePHF Extension (don't edit this comment)
#--------------------------------------------------------
Specify the PHF server URL=Spécifier l'adresse du serveur PHF
PHF server Configuration=Configuration du serveur PHF
Enter the PHF server URL:=Entrez l'adresse du serveur PHF:
Save page As P&HF ...=Enregistrer la page en P&HF ...
PHF &Server=&Serveur PHF
&Compress HTML=&Compresser le HTML
#--------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc





Edited 1 time(s). Last edit at 07/23/2009 10:03AM by JujuLand.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: rodocop
Date: March 04, 2018 10:52PM

Substitution for old PHF service as well as KMA and MHT service, which are partly or entirely obsolete now in KM.

SavePHF extension uses premade userscript Save snapshot (by russian comrade Lex ©) to save page or selection in PHF-format.

Adds items Save to PHF to File menu and Compact Menu as well as Save selection to PHF to selection context menu.

Enjoy!

P.S. You should name the file (instead preset dummy name) and give it an extension in Save dialog. You can make it .phf or .htm/.html/.mht/.kma - whatever.
This would be just plain html-page with embedded content - fully compatible with any modern browser.



Edited 3 time(s). Last edit at 03/04/2018 10:56PM by rodocop.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: Yogi
Date: March 05, 2018 12:58AM

Nice to hear about Lex. smiling smiley
I've lost his trace for many years. Save to PHF was my favorite extension he wrote for Opera Presto before Opera got default support to save as MHT (web archive).

Options: ReplyQuote
Re: kma service (experimental)
Posted by: rodocop
Date: March 05, 2018 01:55AM

Nothing disappears in vain ;-)

Well, Lex was doing much for K-Meleon also earlier. Sometimes see him on ru-board (russian IT forum). But rarely.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: Yogi
Date: March 05, 2018 05:54PM

Quote
rodocop
P.S. You should name the file (instead preset dummy name) and give it an extension in Save dialog. You can make it .phf or .htm/.html/.mht/.kma - whatever.
This would be just plain html-page with embedded content - fully compatible with any modern browser.

Hmm, I thought it would save the page as web archive as it did in Opera Presto.
I'm afraid that I'm missing something here because for just saving to a plain html-page, an extension makes little sense. :s

Options: ReplyQuote
Re: kma service (experimental)
Posted by: rodocop
Date: March 05, 2018 06:42PM

Well, it actually saves PHF (with all content embedded, sure).

This (quoted) is just a little clarification for novices meaning that PHF doesn't require any specific browser or addon to open it.



Edited 1 time(s). Last edit at 03/05/2018 06:43PM by rodocop.

Options: ReplyQuote
Re: kma service (experimental)
Posted by: Yogi
Date: March 05, 2018 07:20PM

Quote
rodocop
Well, it actually saves PHF (with all content embedded, sure).

I've tested it and it doesn't work for me at least.
No embedded images (except for small SVG) on the site I've tested.
If you open the saved page, images get retrieved online. Without internet access no images. A fake web archive so to speak. :O

Options: ReplyQuote
Re: kma service (experimental)
Posted by: rodocop
Date: March 05, 2018 09:12PM

well, I'm forced to confirm: it works fully only for a little part of sites. So, we haven't any working archive extension here and now...

Options: ReplyQuote
Pages: Previous123Next
Current Page: 2 of 3


K-Meleon forum is powered by Phorum.