WebApp-in-a-bookmark (offline Safari applications)

Discussion in 'Mobile Web Development' started by Scythal, Dec 6, 2007.

  1. Scythal

    Scythal New Member

    Joined:
    Nov 27, 2007
    Messages:
    413
    Likes Received:
    4
    Device:
    iPod touch
    I posted something similar as an answer to a totally different question in another part of the forums, but in case it could help someone in achieving some dark purpose... here's my tuppence worth to web applications on the iPod.

    Instead of accessing the application online, you can provide an alternative link which looks like this:

    <a href="data:text/html;charset=utf-8;base64, {some hideous base 64 encoding here}">Offline</a>

    In fact, the whole application - HTML, Javascript and images - can be stored in this data URL, so it allows anyone to store it in a bookmark and run the application offline, without any Wi-Fi connection.

    If you are interested, here is a link which is a good starting point to investigate it further:

    http://www.hackszine.com/blog/archive/2007/07/offline_iphone_apps_with_rfc_2.html

    An encoder (select HTML, base 64 encoding and text/html MIME type):

    http://www.scalora.org/projects/uriencoder/

    There are a few scripts and web pages that do the conversion but they are not perfect, they will omit images, CSS, ... so there is also some work to be done in that area for anyone who has too much time on their hands.

    Hope it may be useful to someone.
  2. cantor

    cantor New Member

    Joined:
    Nov 24, 2007
    Messages:
    5
    Likes Received:
    0
    Stupid! Just install a web server like apache or lighthttpd and that's it!
  3. Scythal

    Scythal New Member

    Joined:
    Nov 27, 2007
    Messages:
    413
    Likes Received:
    4
    Device:
    iPod touch
    Acutally it's not stupid at all, if you think about it.

    Yes, of course you can ask everyone who wants to use a web application to install on their iPod an Apache/Lighttpd server - which is a little heavier by the way - and try grabbing all the necessary files with wget or another web ripper. Then to install all that locally. I'm not sure your average user is ready to do that (I'd say no just at looking at the help sections of these forums) but even so, seen like that... your server option looks stupid

    Please Register or Log in to view images



    Try to see the whole picture next time, before saying an idea is stupid.
  4. inatightspot

    inatightspot New Member

    Joined:
    Nov 24, 2007
    Messages:
    173
    Likes Received:
    2
    show me how



    3 vs 173
  5. Scythal

    Scythal New Member

    Joined:
    Nov 27, 2007
    Messages:
    413
    Likes Received:
    4
    Device:
    iPod touch
  6. Winterboard

    Winterboard Well-Known Member

    Joined:
    Dec 26, 2007
    Messages:
    2,345
    Likes Received:
    53
    Device:
    iPad 2 (Black)
    Thanks for the info. This is very interesting. I knew about the formatting but I didn't know you could save it offline!

    And sorry for bumping the last thread in this whole section

    Please Register or Log in to view images

Share This Page