Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
Adapting more chrome parts from FF for KM
Posted by: rodocop
Date: April 22, 2015 08:57PM

New thread devoted to additional chrome parts from Gecko that could be adapted for KM (like naruman did in his '+1' builds). So, where are you, naruman? :O

First point is attempt to add 'pageinfo' and 'newtab' modules, that were already in naruman's last build.

The target is to get them working into standard KM's architecture like regular 'inbuilt' parts.

JamesD,
there isn't problem here to add menu items. The problem is to select that 'browser' items, modules and components that are needed to drive these added chrome-parts.

I've tried to transfer 'newtab' feature but cannot find how it was being registered for about: protocol (other stuff register itself through 'components' and their manifests, but I had no luck to discover the registration procedure for 'newtab'.

PageInfo option doesn't need such a registration (as it's called as a separate XUL-window not as about:-page). But it may need some dependencies in all that stuff, added by naruman.
The goal is to find it, clear from unneeded stuff and add to regular KM's omni.ja.

Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: JamesD
Date: April 22, 2015 11:39PM

Quote
rodocop
PageInfo option doesn't need such a registration (as it's called as a separate XUL-window not as about:-page). But it may need some dependencies in all that stuff, added by naruman.
The goal is to find it, clear from unneeded stuff and add to regular KM's omni.ja.

Not too sure about the registration. I got a message about "no chrome package registered" until I put the following in kmeleon.manifest file.

content pageinfo kmeleon/content/pageinfo/

That allowed this call in my macro to open the file.

opennew("chrome://pageInfo/content/pageInfo.xul");

I have put the pageinfo folder in the same folder where the console2 folder resides. It does not run yet because I don't think I have all the parts moved to our omni.

The question is how do I proceed from here.

Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: rodocop
Date: April 23, 2015 06:11AM

I shell tell you about my research in ABP-case:

First, I've got into obviously used parts as xul- and js-files (adblockplus.*; and in current case - pageinfo.*)

Not all dependencies were discoverable that way though.

Second technique was to create clean profile in '74+1', open KM with 1 tab and use needed function.

Than close KM and look into startupCache folder under Profiles\xxxxxx.default

That components residing there all are needed with high possibility.

Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: rodocop
Date: April 23, 2015 06:54AM

For PageInfo being called it shows me next chrome objects:

chrome\browser\content\browser\pageinfo\feeds.js
chrome\browser\content\browser\pageinfo\pageInfo.js
chrome\browser\content\browser\pageinfo\permissions.js
chrome\browser\content\browser\pageinfo\security.js
chrome\browser\content\browser\utilityOverlay.js


resource\gre\chrome\toolkit\content\global\contentAreaUtils.js
resource\gre\chrome\toolkit\content\global\globalOverlay.js
resource\gre\chrome\toolkit\content\global\treeUtils.js


last three are called from 'big' omni.ja in KM-rootfolder (GRE back-end itself) not in browser subfolder 'little' omni.ja (that is the front-end chrome part).

registration address resource\gre\chrome\toolkit\content refers to ROOTFOLDER\omni.ja\chrome\toolkit\content for example.

Since full GRE should contain all the needed parts (except for that removed on the road from 24 to 31 - this is not our case), we just need to assure that they ARE there in place.

But all that is loaded from 'browser'-chrome we should take in account.

Content-scripts, shown above, all are definitely needed. But the question is about components and modules.
StartupCache shows that next were loaded:

browser\components\DownloadsStartup.js
browser\components\kmAddon.js
browser\components\kmAddonManager.js
browser\components\KmeleonMain.js
browser\components\kmLoginManager.js
browser\components\kmSearchService.js
browser\components\nsBrowserGlue.js
browser\components\nsSidebar.js
browser\components\WebContentConverter.js


browser\modules\distribution.js
browser\modules\SignInToWebsite.jsm


Not all of them are connected with PageInfo though. The only way to know exactly is trial and error method I think.



Edited 1 time(s). Last edit at 04/23/2015 06:56AM by rodocop.

Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: JamesD
Date: April 23, 2015 12:51PM

This file is important. browser\components\KmeleonMain.js

The menu item came from it and there are observers set also. This may be well beyond my knowledge. I will give a little more time and see if I get any results. I do not plan to make it my life's work.

Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: JamesD
Date: April 27, 2015 01:51PM

I think that these instructions will allow the "View Page Info" part to be correctly added to KM 75.

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

These instructions are included in PageInfoSys.7z
Instructions to add "View Page Info" to K-Meleon 75

Included items list:
1. These instructions  "Instructions.txt"
2. The data files for chrome  "PageInfo.7z"

You will need to create a work folder on your computer.

 1.  Copy your current omni.ja file in root\browser to work folder.
 2.  Change the name from omni.ja to omni.zip and extract all files.
 3.  Delete or rename the omni.zip file.  omni.zip > origomni.zip
 4.  Extract the PageInfo.7z to the work folder.
 5.  Edit the "chrome.manifiest file in the work folder.
     Add the following line to the existing lines there.
     
         manifest components/KmeleonMain.manifest
    
 6.  Save the "chrome.manifiest file in the work folder.
 7.  Use your "zip" and add all files ( except origomni.zip )
     to a omni.zip file.  Use compression level "store" for
     a safe, but larger file or compression level "normal" for
     a smaller file.  Note: not all systems can use normal.
 8.  Rename you new omni.zip to omni.ja. 
 9.  Rename or back up your omni.ja which is in root\browser.
10.  Copy your new omni.ja from work folder to root\browser.
11.  IMPORTANT! Delete the folder name startupCache in your profile.
12.  Start KM and use right click to obtain the Document Popup menu.
     View Page Info will be located near the bottom of the menu.  


Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: JamesD
Date: April 27, 2015 05:08PM

Naruman's code did not contain any information in root\locales. Would the necessary data for PageInfo be in FF? Does anyone have that?

Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: rodocop
Date: April 27, 2015 06:38PM

locales needed are contained in FF-locales as pageinfo.dtd and pageinfo.properties under <localecode>\locale\browser
but first was modified probably so localizers need to add and translate 3 lines:
<!ENTITY  open.key              "O">
<!ENTITY  open.label            "Open">
<!ENTITY  open.accesskey        "O">


Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: rodocop
Date: April 27, 2015 06:49PM

Also we need kml-file with 1 line to translate menu item.

I've made this for russian - localizers, feel free to adapt it for other languages

Attachment: files to translate with a short instruction

Attachments: pageinfo.7z (2.2 KB)  
Options: ReplyQuote
Re: Adapting more chrome parts from FF for KM
Posted by: rodocop
Date: April 27, 2015 06:52PM

Also I see that my AdBlockPlus package contains almost all we need to get PageInfo (except properties-file).

Now you can get ABP+PageInfo package (en-US+ru) here from Mega

Simply unpack into your KM RC2 (or b3) folder and enjoy!

All kudos to JamesD for his great job!

P.S. ru-locale also renewed in corresponding thread



Edited 5 time(s). Last edit at 04/27/2015 07:10PM by rodocop.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.