Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HTML Packer

66 views
Skip to first unread message

0ntario...@gmail.com

unread,
Nov 8, 2014, 4:37:11 AM11/8/14
to
Ever hear of a JavaScript packer, shrinker, minifier? Well here I introduce an online HTML code packer http://www.scriptcompress.com/HTML-Packer.htm

Question: How does it work?

Answer: Basically it works by finding repeated words/phrases and replacing them with a single character. Here are the steps: The app takes your HTML coding (you may embed CSS, pics VIA DataURI like MIME, JavaScript), breaks it apart, removes all non aphabet characters, makes an array of left over character clumps, finds out which phrases a repeated, removes non repeated words, replaces repeated word list with matching character list of unused characters, and finally it packs it all up in a self executing & self extracting JavaScript for you.

This portable (download page and use offline) web based application does not change your code, it does not remove comments, no minification (removing whitespace, line breaks, etc) is performed, just pure replacing and packing.

http://marklets.com/HTML%20Packer.aspx for the bookmarklet.

http://www.scriptcompress.com/JavaScript-Packer.htm for JavaScript version or advanced version on http://www.scriptcompress.com

Thomas 'PointedEars' Lahn

unread,
Nov 8, 2014, 7:44:44 AM11/8/14
to
0ntario...@gmail.com wrote:

> Ever hear of a JavaScript packer, shrinker, minifier? Well here I
> introduce an online HTML code packer
> http://www.scriptcompress.com/HTML-Packer.htm
>
> Question: How does it work?

It does not. You have not considered, to begin with, user agents that do
not support client-side scripting or do not have it enabled, or do not
provide the required features; that includes search engines. So it will be
already hard to find someone wanting to use it just because of that.


PointedEars
--
Sometimes, what you learn is wrong. If those wrong ideas are close to the
root of the knowledge tree you build on a particular subject, pruning the
bad branches can sometimes cause the whole tree to collapse.
-- Mike Duffy in cljs, <news:Xns9FB6521286...@94.75.214.39>
Message has been deleted

Christian White

unread,
Nov 8, 2014, 8:15:07 AM11/8/14
to
Ahh, you again Thomas (blush, starting to think you like me).

I used it plenty already. I often need to pack up HTML to embed in say a SVG image. You may not be able to find uses for it, but doesn't mean other people cannot.

Christoph M. Becker

unread,
Nov 8, 2014, 8:22:28 AM11/8/14
to
Christian White wrote:

> It's a packer, that's what packers do.

What do packers do? Please quote relevant parts of the message you are
replying to; this is Usenet and not a Web forum.

--
Christoph M. Becker


Thomas 'PointedEars' Lahn

unread,
Nov 8, 2014, 8:29:13 AM11/8/14
to
Christian White wrote:

> It's a packer, that's what packers do.

Do what? When will you learn to quote the parts that you are replying to as
you have been told before?

A *HTML* packer would generate *HTML*, not a client-side script. For
example, it is possible to reduce all class names and IDs and get equivalent
markup, provided that the stylesheets and client-side scripts associated
with them are modified as well (this will be easier to do with stylesheets,
harder with client-side scripts). But a few bytes less are hardly worth it.

As you have been told before, too, please do not use Google Groups for
posting to Usenet. It is broken. Because it is also the source of the
majority of spam on Usenet, you are reducing your audience.


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

Thomas 'PointedEars' Lahn

unread,
Nov 8, 2014, 8:31:33 AM11/8/14
to
Christian White wrote:

> Ahh, you again Thomas (blush, starting to think you like me).

You just happen to post (cluelessly) to the newsgroups that have subscribed
to.

> I used it plenty already. I often need to pack up HTML to embed in say a
> SVG image.

That SVG image would not display without client-side script support. SVG
images are not supposed to work like that.

> You may not be able to find uses for it, but doesn't mean other
> people cannot.

Hence I did not say that. Learn to read and get a minimum clue.


PointedEars
--
When all you know is jQuery, every problem looks $(olvable).

Christian White

unread,
Nov 8, 2014, 8:40:05 AM11/8/14
to
Well Thomas... http://imgh.us/KJV-Holy-Bible.svgz (loads in new window) that's originally a 7MB text (with <br><p> tags) Holy Bible that I packed to JavaScript from basic HTML, packed it again, then compressed it. All using tools from www.ScriptCompress.com

That Entire Bible is now less than 900KB. Even Gzip Couldn't make that Bible less than 1.5MB.

Christoph M. Becker

unread,
Nov 8, 2014, 9:24:11 AM11/8/14
to
Christian White wrote:

> Well Thomas...

Which Thomas are you referring to?
And it even can be read if JavaScript is enabled, SVG is supported and
one has a very powerful machine (others will most likely cancel the
request after 5 - 10 seconds).

A much saner approach would have been to split the HTML into individual
chapters, offering a table of contents and maybe a server side search
functionality. Besides improving the usability (let alone
accessibility), due to browser side caching that could have even saved
way more bandwidth.

--
Christoph M. Becker

Christoph M. Becker

unread,
Nov 8, 2014, 9:41:58 AM11/8/14
to
Christoph M. Becker wrote:

> Christian White wrote:
>
>> http://imgh.us/KJV-Holy-Bible.svgz (loads in new
>> window) that's originally a 7MB text (with <br><p> tags) Holy Bible
>> that I packed to JavaScript from basic HTML, packed it again, then
>> compressed it. All using tools from www.ScriptCompress.com
>>
>> That Entire Bible is now less than 900KB. Even Gzip Couldn't make
>> that Bible less than 1.5MB.
>
> A much saner approach would have been to split the HTML into individual
> chapters, offering a table of contents and maybe a server side search
> functionality. Besides improving the usability (let alone
> accessibility), due to browser side caching that could have even saved
> way more bandwidth.

Of course, the last argument is nonsense, as the SVG can also be cached
by the browser. However, saving bandwidth would still be possible by
splitting the HTML, because many readers are likely to read only parts
of the Bible.

--
Christoph M. Becker

Ben Bacarisse

unread,
Nov 8, 2014, 10:07:44 AM11/8/14
to
Christian White <0ntario...@gmail.com> writes:

> Well Thomas... http://imgh.us/KJV-Holy-Bible.svgz (loads in new
> window) that's originally a 7MB text (with <br><p> tags)

I ran the scripts and it produced 4.1MB of HTML not 7MB. (And why is
this an SVG image?)

> Holy Bible
> that I packed to JavaScript from basic HTML, packed it again, then
> compressed it. All using tools from www.ScriptCompress.com
>
> That Entire Bible is now less than 900KB. Even Gzip Couldn't make that
> Bible less than 1.5MB.

gzip can compress the 4.1MB to 1.2MB -- less than 1.5MB.

The process you originally described -- the word list packing -- turns
the 4.1MB text into it 2.4MB. The 1.2MB file (the one you gzip to get
<900MB) uses another stage of compression and encoding. In short, two
levels of scripted compression and encoding plus gzipping the result
saves you about 0.33MB.

as it happens, bzip2 compresses the original text to less than 900KB in
one go. (Not that Content-Encoding: bzip2 is officially endorsed --
it's just a data point for your compression.)

But Thomas's points are not about the compression, but about the
disadvantages of doing this at all. In case it's not clear, I agree:
the whole idea is a bad one. My point is only that you are overselling
it in a way that will make people suspicious.

--
Ben.

Christian White

unread,
Nov 8, 2014, 10:33:23 AM11/8/14
to
This way someone can do a search through the whole Bible at once for quicker references. Was my purpose. Your way you could only search through a little bit. Avid Bible readers would probably prefer entire compilation.

Thomas, stop trolling me!

Christian White

unread,
Nov 8, 2014, 10:38:47 AM11/8/14
to
What are you suspicious of Ben?

Christian White

unread,
Nov 8, 2014, 10:42:08 AM11/8/14
to
RE: Incorrect size:

Maybe it was this one: http://imgh.us/NIV-Holy-Bible.svgz as I am not sure now, I have several versions I made.

Christian White

unread,
Nov 8, 2014, 10:45:18 AM11/8/14
to

Christian White

unread,
Nov 8, 2014, 10:48:29 AM11/8/14
to
Size error, figured it out: http://imgh.us/NIV-Holy-Bible.svgz that was the one. I dug it out of an Android application that was over 7MB as a *.pak file.

Christian White

unread,
Nov 8, 2014, 10:56:31 AM11/8/14
to
And yes, it was partially bzipped (BZip2). I may have also have used lz77, lzw, lzma, gzip or some other experimental thing I was trying during development of www.scriptcompress.com. Many of these compression formats are available on the site to use.

tlvp

unread,
Nov 8, 2014, 11:48:40 AM11/8/14
to
On Sat, 8 Nov 2014 07:56:30 -0800 (PST), Christian White wrote:

> And yes, it was partially bzipped (BZip2). I may have also have used lz77, lzw, lzma, gzip or some other experimental thing I was trying during development of www.scriptcompress.com. Many of these compression formats are available on the site to use.

In this, and in several posts submitted less than 20 minutes earlier, you
refer to an unidentified "it". What is (or are) these "it" references
referring to? All context is absent from those posts. Thanks. -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.
Message has been deleted

Thomas 'PointedEars' Lahn

unread,
Nov 8, 2014, 1:58:36 PM11/8/14
to
Christoph M. Becker wrote:

> A much saner approach would have been to split the HTML into individual
> chapters, offering a table of contents and maybe a server side search
> functionality. Besides improving the usability (let alone
> accessibility), due to browser side caching that could have even saved
> way more bandwidth.

There is a theory that this has already happened.


PointedEars ;-)

Christoph M. Becker

unread,
Nov 8, 2014, 2:03:57 PM11/8/14
to
Thomas 'PointedEars' Lahn wrote:

> Christoph M. Becker wrote:
>
>> A much saner approach would have been to split the HTML into individual
>> chapters, offering a table of contents and maybe a server side search
>> functionality. Besides improving the usability (let alone
>> accessibility), due to browser side caching that could have even saved
>> way more bandwidth.
>
> There is a theory that this has already happened.

I know -- now. See my "PS" in <news:m3la3k$i8v$1...@solani.org>.

--
Christoph M. Becker

James Moe

unread,
Nov 8, 2014, 2:04:24 PM11/8/14
to
On 11/08/2014 02:37 AM, 0ntario...@gmail.com wrote:
> Answer: Basically it works by finding repeated words/phrases and replacing them with a single character.
>
Which is one of the many thinks well-established archive packages do:
zip, gzip, bzip2, 7z, rar, on and on. And they will do a far superior
job of compressing the file. If you require JS to process a packed HTML
file, why not use something that does the compressing in some standard way?

--
James Moe
jmm-list at sohnen-moe dot com

Thomas 'PointedEars' Lahn

unread,
Nov 8, 2014, 2:35:44 PM11/8/14
to
See my smiley in <news:1694189.o...@PointedEars.de> [1]


PointedEars
___________
[1]
<https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker's_Guide_to_the_Galaxy>
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14

JJ

unread,
Nov 8, 2014, 8:16:29 PM11/8/14
to
Unfortunately, I find it less efficient and preferable.
With the original unpacked sample HTML code, when the data is served
GZipped, it's 711 bytes.
But with the packed code, the GZipped data is 835 bytes. Bigger than the
GZipped unpacked code.
Moreover, obfuscated code wil always cause suspicions.

Grant

unread,
Nov 8, 2014, 9:09:40 PM11/8/14
to
And, you may setup the web server to deliver gzip compressed files where
possible, negotiated with the connected user agent. This is transparent
to the user. More info on: <http://bugsplatter.id.au/pakweb/> (five
years old, going by the source file datestamp.)

The thing is running a script on the server to expand the SSL and compress
the .html files. This pre-processing cuts server load and allows pages
to be cached.

There's no need for reinventing the wheel. Use what's available.

Grant.

ner...@gmail.com

unread,
Nov 11, 2014, 8:39:15 AM11/11/14
to
It's great for email obfuscating and hiding data from being picked up by search engines, beats having to Base64 encode everything and having it get 30% bigger. I would rather 30% smaller...

Christian White

unread,
Nov 26, 2014, 11:41:13 PM11/26/14
to
http://www.scriptcompress.com/HTML-Packer.htm

Not all servers let you adjust compression settings. I can host packed/compressed files on free hosting places that have no Gzip.

Packing HTML has many other uses, you have to think outside the box. I can pack HTML to JavaScript and then embed it in a SVG image and then Gzip and share it as a SVGZ file compressed (client side decompress) like this http://www.scriptcompress.com/JavaScript-Packer.svgz or non Gzip example: http://imgh.us/matrix.svg

It is not my fault search engines do not read from JavaScript, they should eval it and stuff.

Christian White

unread,
Nov 28, 2014, 9:43:59 AM11/28/14
to
On Saturday, November 8, 2014 8:16:29 PM UTC-5, JJ wrote:
Sorry about the problems with Gzip, I didn't make it. If the browser and JavaScript had built in support for all the top compression formats, there would be other combinations to get actual compression.

Christian White

unread,
Dec 16, 2014, 12:57:40 AM12/16/14
to

Christian White

unread,
Dec 22, 2014, 8:16:47 PM12/22/14
to
http://www.scriptcompress.com/HTML-To-JavaScript-Compressor.htm

This version will compress large pages fine. I used a 4MB Holy Bible HTML5 App and shrunk it down to 2MB JavaScript. It creates a self extracting and self executing script to document.write your data.

Now I can inject the variable X to say an iframe in a SVG image. If I simply had Base64 encoded the complete Holy Bible, I wound up with over 5MB DataURL (use for embedding).

Denis McMahon

unread,
Dec 23, 2014, 3:06:14 PM12/23/14
to
On Mon, 22 Dec 2014 17:16:45 -0800, Christian White wrote:

> I used a 4MB Holy Bible

Was this the New World Translation, the Authorised King James, the Douay,
or some other variant?

--
Denis McMahon, denismf...@gmail.com

Christian White

unread,
Dec 24, 2014, 1:41:26 PM12/24/14
to
With tool http://www.scriptcompress.com/HTML-To-JavaScript-Compressor.htm I was able to take a 4MB text (escaped to JavaScript and injects to a textarea box) of the 1611 King James Version complete Holy Bible (New & Old Testaments).

Christian White

unread,
Dec 24, 2014, 2:05:13 PM12/24/14
to
On Saturday, November 8, 2014 4:37:11 AM UTC-5, Christian White wrote:
> Ever hear of a JavaScript packer, shrinker, minifier? Well here I introduce an online HTML code packer http://www.scriptcompress.com/HTML-Packer.htm
>
> Question: How does it work?
>
> Answer: Basically it works by finding repeated words/phrases and replacing them with a single character. Here are the steps: The app takes your HTML coding (you may embed CSS, pics VIA DataURI like MIME, JavaScript), breaks it apart, removes all non aphabet characters, makes an array of left over character clumps, finds out which phrases a repeated, removes non repeated words, replaces repeated word list with matching character list of unused characters, and finally it packs it all up in a self executing & self extracting JavaScript for you.
>
> This portable (download page and use offline) web based application does not change your code, it does not remove comments, no minification (removing whitespace, line breaks, etc) is performed, just pure replacing and packing.
>
> http://marklets.com/HTML%20Packer.aspx for the bookmarklet.
>
> http://www.scriptcompress.com/JavaScript-Packer.htm for JavaScript version or advanced version on http://www.scriptcompress.com

With tool http://www.scriptcompress.com/HTML-To-JavaScript-Compressor.htm I used a HTML version of NIV New/Old complete that was originally a 8MB Android application that I unpacked and manipulated.

I just now was able to take a 4MB text (escaped to JavaScript and injects to a textarea box) of the 1611 King James Version complete Holy Bible (4,341,926 bytes containing New & Old Testaments) to 1.69MB (1,773,643 bytes).

Christian White

unread,
Mar 7, 2015, 3:48:24 PM3/7/15
to
On Saturday, November 8, 2014 at 4:37:11 AM UTC-5, Christian White wrote:
> Ever hear of a JavaScript packer, shrinker, minifier? Well here I introduce an online HTML code packer http://www.scriptcompress.com/HTML-Packer.htm
>
> Question: How does it work?
>
> Answer: Basically it works by finding repeated words/phrases and replacing them with a single character. Here are the steps: The app takes your HTML coding (you may embed CSS, pics VIA DataURI like MIME, JavaScript), breaks it apart, removes all non aphabet characters, makes an array of left over character clumps, finds out which phrases a repeated, removes non repeated words, replaces repeated word list with matching character list of unused characters, and finally it packs it all up in a self executing & self extracting JavaScript for you.
>
> This portable (download page and use offline) web based application does not change your code, it does not remove comments, no minification (removing whitespace, line breaks, etc) is performed, just pure replacing and packing.
>
> http://marklets.com/HTML%20Packer.aspx for the bookmarklet.
>
> http://www.scriptcompress.com/JavaScript-Packer.htm for JavaScript version or advanced version on http://www.scriptcompress.com

Converted one of the advanced JavaScript packers to allow for HTML on http://www.scriptcompress.com/JavaScript-Packers.htm plus you can use a URL query to get source code of any webpage to get packed: http://www.scriptcompress.com/JavaScript-Packers.htm?url=http://www.acme.com

Denis McMahon

unread,
Mar 7, 2015, 8:11:15 PM3/7/15
to
On Sat, 07 Mar 2015 12:48:22 -0800, Christian White wrote:

> Converted one of the advanced JavaScript packers to allow for HTML on
> http://www.scriptcompress.com/JavaScript-Packers.htm plus you can use a
> URL query to get source code of any webpage to get packed:
> http://www.scriptcompress.com/JavaScript-Packers.htm?url=http://
www.acme.com

more www.scriptcompress.com spam spam spam spam spam

--
Denis McMahon, denismf...@gmail.com
Message has been deleted

Christian White

unread,
Mar 7, 2015, 11:54:10 PM3/7/15
to
On Saturday, November 8, 2014 at 4:37:11 AM UTC-5, Christian White wrote:
> Ever hear of a JavaScript packer, shrinker, minifier? Well here I introduce an online HTML code packer http://www.scriptcompress.com/HTML-Packer.htm
>
> Question: How does it work?
>
> Answer: Basically it works by finding repeated words/phrases and replacing them with a single character. Here are the steps: The app takes your HTML coding (you may embed CSS, pics VIA DataURI like MIME, JavaScript), breaks it apart, removes all non aphabet characters, makes an array of left over character clumps, finds out which phrases a repeated, removes non repeated words, replaces repeated word list with matching character list of unused characters, and finally it packs it all up in a self executing & self extracting JavaScript for you.
>
> This portable (download page and use offline) web based application does not change your code, it does not remove comments, no minification (removing whitespace, line breaks, etc) is performed, just pure replacing and packing.
>
> http://marklets.com/HTML%20Packer.aspx for the bookmarklet.
>
> http://www.scriptcompress.com/JavaScript-Packer.htm for JavaScript version or advanced version on http://www.scriptcompress.com

Now you can use a URL query to get source code of any webpage to get packed: http://www.scriptcompress.com/JavaScript-Packers.htm?url=http://www.acme.com

Stan Brown

unread,
Mar 8, 2015, 4:59:32 AM3/8/15
to
Yet, for some reason you found it necessary not only to repost it but
to add a comment giving them even further publicity.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You: http://preview.tinyurl.com/WhyWont
Message has been deleted

Christian White

unread,
Mar 8, 2015, 11:54:35 AM3/8/15
to
If your comment is unrelated to my topic of "Client Side Compression", http://www.scriptcompress.com or HTML5 coding, then your comment is useless spam! A proper response would be to suggest ways to make something better or perhaps a question on how it works. Attacking me or making false accusations about me will not help anyone.

Christian White

unread,
Mar 8, 2015, 12:04:13 PM3/8/15
to
Thanks for advice. But really the best purpose of http://www.scriptcompress.com/JavaScript-Packers.htm packing HTML is client side compression and decompression so that servers can reduce loads. You are in fact doing the opposite.
Message has been deleted
0 new messages