W3C home > Mailing lists > Public > public-webappsec@w3.org > January 2016

Re: PDF alternative using HTML (proposal)

From: Craig Francis <craig@craigfrancis.co.uk>
Date: Tue, 12 Jan 2016 12:06:13 +0000
Cc: public-webappsec@w3.org
Message-Id: <7EAAEAF3-5B7B-4C19-BAC7-FC52B82152C1@craigfrancis.co.uk>
To: Adrian Hope-Bailie <adrian@hopebailie.com>
From a web developers point of view, my replies are below...

> On 12 Jan 2016, at 11:33, Adrian Hope-Bailie <adrian@hopebailie.com> wrote:
> +1 - seems like something worth standardizing if browsers will standardize the security model that is applied to this browsing context.
> Assumptions: 
> ALL embedded resources would be packaged in the archive
> The script execution capabilities of this app would be severely limited (no network requests for example).

Yes to both, I think security/privacy is very important here.

If we start having documents that start reporting on when they are being opened (e.g. via JS or remote image), then people will probably avoid these documents (it needs to be better than PDF in this regard).

> Observations:
> "ability to change layout depending on screen size" means embedding resources for all supported screen sizes in the archive - how big could this archive get? Would be useful to try a few examples and see.

If you are providing images (or dare I say videos), then this may increase the file size a bit, but it's an extra feature that can be used (and probably only in rare cases, like a badly imported image into a PDF).

Generally the strength of HTML/CSS is that it's text, so if anything the file size will probably be very good for the typical document.

> I can see the tooling for this becoming quite powerful and ultimatley allowing you to produce documents and slide decks that are far superior to those from existing proprietary formats.

I think building of these documents would be excellent.

Developers could create a folder with index.html and style.css files, maybe some images, test locally, then zip up the folder and change the extension (the manual approach, but it works).

Users could also visit a website and do a "save page as" and not have to worry about missing images/resources (either because they only saved the HTML, or because the resources are typically put into a separate folder).

And systems that create documents, well they often use HTML to PDF generators already, and they are all pretty bad from my experience.

> I would imagine that if I opened the file /tmp/html-document.hta it would open in my browser and the address bar would show file:///temp/html-document.hta
> Can I browse to other HTML files in the archive? And if so what is their URL?
> E.g. Would the file example/otherfile.html inside the archive be at the URL file:///temp/html-document.hta/example/otherfile.html ?

Personally I wouldn't be using multiple HTML files (I'm currently creating reports that are exported as PDF's, which don't have this ability)... but I don't see why that feature couldn't be included.

I like the idea of just appending onto the base path.

The HTML files themselves can then just do a <a href="../../example/otherfile.html"> to help during development/testing, or just use <a href="/example/otherfile.html">.

> I stole the .hta extension from Microsoft's HTML Applications (https://en.wikipedia.org/wiki/HTML_Application <https://en.wikipedia.org/wiki/HTML_Application>).
> Similar idea with the opposite security principles and very little success as far as I know

I found that someone else was proposing a "hdoc" extension:

http://hdoc.crzt.fr/www/co/hdoc.html <http://hdoc.crzt.fr/www/co/hdoc.html>

Although I think their proposal went a bit far including several meta files which I don't think are needed (just have the requirement of one index.html file).

Personally I don't think it matters which extension we choose :-)

> On 12 January 2016 at 12:54, Craig Francis <craig@craigfrancis.co.uk <mailto:craig@craigfrancis.co.uk>> wrote:
> Hi,
> Recently I've been thinking of some of the problems with PDF's, which are useful for creating a document that can be archived, emailed, printed, etc.
> HTML has solutions for many of PDF's problems though, for example structured text (accessibility), ability to change layout depending on screen size (no need for small screen devices to zoom into a fixed A4 layout), can change font size, better indexing support (searching for documents), etc.
> Unfortunately you can't just email a HTML document to someone, as this causes a range of security problems, and including resources can be difficult (you can inline them, or use MHTML, but these are tricky to create).
> So I was wondering if we could take the approach that Microsoft Word did with the docx format, Java with JAR, PHP with PHAR, etc...
> Have a new file format, associated with the browser, which is just a ZIP/GZIP file that contains an index.html file, and everything else needed for the document.
> Then from a security point of view, it can be locked down to its own little box, so no access to other files on the file system, probably no access to cookies/localstorage, no ability to connect to another host (maybe).
> And from the users point of view, the document could be protected with a password (a feature that ZIP/GZIP provides already, and the browser can prompt for when opening).
> So would this help with the security aspects of emailing HTML files to people (e.g. reports), and be better than PDFs?
> Craig
> https://code.google.com/p/chromium/issues/detail?id=575677 <https://code.google.com/p/chromium/issues/detail?id=575677>
> https://bugzilla.mozilla.org/show_bug.cgi?id=1237990 <https://bugzilla.mozilla.org/show_bug.cgi?id=1237990>

Received on Tuesday, 12 January 2016 12:06:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:54:54 UTC