Chromeflat extension

A section for all development and testing programmes and customised browsers written by SillyDog701 community. Featured products including Donzilla, Firescape, DJGM Distro, and Netscape Streamline.

Moderator: Don_HH2K

Chromeflat extension

Postby Don_HH2K » Fri 17 Mar, 2006 7:58 pm

Chromeflat is something I worked on to flatten a Mozilla chrome without specifying [tt]ac_add_options --enable-chrome-format=flat[/tt] at build time.

[tt]Chromeflat.vbs[/tt] is a WSH-enabled script that does five things:
  1. Make directories for each JAR
  2. Unzip each JAR to that directory
  3. Delete the JAR
  4. Edit installed-chrome.txt appropriately using [tt]sed[/tt]
  5. Remove *.rdf files, which Mozilla will rebuild on launch
The benefits:
  • A flat chrome starts up faster than a JAR'ed chrome, since the archives are read in a native folder structure instead of through Gecko's libjar implementation.
  • It's eons easier to develop for, since you don't need to de-JAR and re-JAR the archives while editing them
  • Since Mozilla JARs aren't compressed by default, they take up more space than with a native file structure.

The drawback: I have not yet managed to implement manifest support, which doesn't mean much for Mozilla, though it will completely break Firefox and possibly some far-off Mozilla builds that use manifests instead of installed-chrome.txt.

Instructions: Unzip to the top-level directory of Mozilla, and run [tt]chromeflat.vbs[/tt]. Users of Windows 9x/ME will need to download Windows Scripting Host to make this work; it will work out-of-the-box in 2000 and higher.

Download it here.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 Donzilla/1.1PR1 (WML/1.3)
Last edited by Don_HH2K on Fri 17 Mar, 2006 9:15 pm, edited 1 time in total.
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Postby Don_HH2K » Fri 17 Mar, 2006 8:02 pm

I should also mention that Pu7o created a shell script for Linux and OS X that is available here. [tt]chromeflat.sh[/tt] does the same things using shell scripting instead of Windows Scripting Host.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 Donzilla/1.1PR1 (WML/1.3)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Postby Pu7o » Fri 17 Mar, 2006 8:19 pm

You might want to re-consider flattening the chrome. According to the folks at irc.mozilla.org, a flat chrome is actually slower than a zip -0 jar chrome (zip -0 being an uncompressed zip file) because of the added Disk I/O that mozilla has to perform. Quoting a mozilla developer:

Benjamin Smedberg wrote:According to significant testing, flat chrome takes a lot longer to startup
because of disk IO: combining files in a JAR is significantly less overall
stat+read IO.


A zip-0 jar file can be created using Info-ZIP, and passing the -0 parameter to its zip command.

(see https://bugzilla.mozilla.org/show_bug.cgi?id=328845 for more information)
UserAgent: Opera/8.52 (X11; Linux i686; U; en)
Last edited by Pu7o on Fri 17 Mar, 2006 8:20 pm, edited 1 time in total.
User avatar
Pu7o
Macfox
Macfox
 
Posts: 2014
Joined: Thu 06 Jan, 2005 12:03 pm
Location: Portugal

Postby Don_HH2K » Fri 17 Mar, 2006 8:39 pm

That may or may not be true; personally I've found it to be faster, though I haven't tried JAR vs flat Donzilla in awhile, so I have no idea what the true difference is.

I'll still stand by the fact that it's a lot easier to read and make edits to a native file structure than unzipping and rezipping a JAR file.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 Donzilla/1.1PR1 (WML/1.3)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Postby Pu7o » Fri 17 Mar, 2006 8:45 pm

by the way, that script calls sed.exe and unzip.exe, plus it calls local copies. I made it for use on windows with the win32 zsh, it won't work on an unix system.

As for your vbs script, you forgot the download link :oops_sign:
UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/420+ Trunk/20060316 (KHTML, like Gecko) Shiira/1.2.2 Safari/125
Last edited by Pu7o on Fri 17 Mar, 2006 8:46 pm, edited 1 time in total.
User avatar
Pu7o
Macfox
Macfox
 
Posts: 2014
Joined: Thu 06 Jan, 2005 12:03 pm
Location: Portugal

Postby Don_HH2K » Fri 17 Mar, 2006 9:17 pm

Download link added, my bad. :oops:
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 Donzilla/1.1PR1 (WML/1.3)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Re: Chromeflat extension

Postby Antony » Wed 22 Mar, 2006 5:36 pm

Don_HH2K wrote:[tt]Chromeflat.vbs[/tt] is a WSH-enabled script that does five things:
What is "WSH"?
UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.9.2
User avatar
Antony
diamond member
diamond member
 
Posts: 14509
Joined: Tue 18 Jun, 2002 11:36 pm
Location: Sydney, Australia

Postby Don_HH2K » Wed 22 Mar, 2006 5:41 pm

WSH stands for Windows Scripting Host. It's similar to Active Server Pages (a Web standard), but it's designed for use on the local computer. Its principles and most of its objects are the same; for example, I can use Scripting.FileSystemObject from ASP and WSH using [tt]CreateObject("Scripting.FileSystemObject")[/tt], and the commands would be exactly the same (save for a client path as opposed to a server path).
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 Donzilla/1.1PR1 (WML/1.3)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm


Return to SD701 DevZone

Who is online

Registered users: Google [Bot]