Does the UIWebView can use the HTML5 AppCache - ios

I have an UIWebView which loads sites that made in HTML5. A manifest is implemented too. So my question is can I use the HTML5 AppCache or do I have to develope it by myself?
This post tells me that the UIWebView can't use the HTML5 AppCache. Is that correct?

It can be done, but you're limited to only about 5MB of cache storage. You build a .manifest file which tells UIWebView which files to cache. You should read your indicated post for further information.

Related

Is it possible to use the openlayers where we dont have internet connectivity?

Since most of the example available in Internet is working based on Internet.
I would like to download and use. I don't want to use either CDN or openlayer.org in my code.
Is it possible to use openlayers without a CDN?
Yes. Like any library, you can download locally. This page has some download links to get the CSS and JS files: https://openlayers.org/download/
You download and unzip those into a folder that is accessible from your web server. Usually this is a scripts subfolder
Then you simply reference them as explained here:
https://www.w3schools.com/css/css_howto.asp
https://www.w3schools.com/tags/att_script_src.asp
(note these are very basic W3C references. You should really know this)
So if you downloaded those .js and .css files into a scripts subdirectory you do this:
<script src="scripts/theopenlayersscriptfile.js"></script>
<link rel="stylesheet" type="text/css" href="scripts/theopenlayerscssfile.css">
Edit:
After some experimenting and investigation, you mention that it is trying to access https://c.tile.openstreetmap.org/4/6/6.png
I googled and found this link
https://wiki.openstreetmap.org/wiki/OpenLayers_Local_Tiles_Example
Which says
With this example you can browse your tiles stored localy without any webserver. I use this to check my tiles I downloaded to use in Osmtracker. But you can also browse Tiles rendered by any other techniques.
The instructions at this link appear to explain exactly what you want to do - it has references to all of the files you are trying to use.

UIWebView cannot read correctly some local HTML5 stuff

Here I come with a new challenge for you all, Objective-C developers:
I'm trying to load some HTML5 exports from Articulate into an UIWebView. Well, at first sight it's quite simple: just put the HTML5 resources into the project and call index.html.
Well, that simply doesn't work if the HTML5 resource have a complex javascript structure. Specially with <audio> and <video> tags.
Any idea?
I've been investigating for hours and the solution appeared with some lateral thinking:
If the main problem is that reading locally doesn't work, but the app requirements forces you to maintain the content offline, then let's serve the content locally!.
Here are the steps I followed to resolve this issue:
Embed a web server into your app (I prefer GCDWebServer)
Let GDCWebServer serve your storyline locally with: [webServer startWithOptions:#{#"BindToLocalhost": #YES} error:nil];
Use WKWebView to call your local web server with: [wkView loadRequest:[NSURLRequest requestWithURL:webServer.serverURL]];
Then you will see your Articulate storyline working perfectly in your app inside a window, with iOS8.
Hope this can help someone.

iOS : load content for UIWebView from Server

I'd like to load content (HTML / CSS, Javascript - all files packed in a zip-file) into my application folder and runs it in an UIWebView. I guess this is possible, however I'm not sure if Apple allows it.
So Is the dynamic loading and storing of HTML pages generally allowed?
Thanks a lot.
Yes you can. Loading of web pages that way is fine as far as I know. I am working on a project that uses this zip archive tool to unpack the zip. It is a object oriented C wrapper on minizip
http://code.google.com/p/ziparchive/source/browse/trunk/ZipArchive.h

Is there a framework to cache HTML pages on iOS?

I'm looking to cache HTML pages inside an application that uses UIWebView.
Is there a framework that will allow me to do this and if not what method would you recommend?
On the server side these files are being seen as PHP so I'd just be caching whatever the file gives back out.
I used RNCachingURLProtocol , a way to do drop-in offline caching for UIWebView
Reference:
http://robnapier.net/blog/offline-uiwebview-nsurlprotocol-588

Firefox question: Is it possible to create an html iframe which loads a document from my extension using the chrome://?

I was wondering if it is possible to create an iframe whithin a HTML document pointing to a XUL document whithin my firefox extension such like:
<iframe src="chrome://myextension/content/document.xul"/>
I am currently getting security errors when trying to do this. I've already tried the contentaccessible=yes flag in my chrome.manifest but it didn't work.
Is there any workaround to get this working?
Thanks.
No, web pages are generally not allowed to load chrome documents. contentaccessible=yes refers to images and scripts that are less regulated security-wise (they can also be used across domains). However, your extension has permission to load chrome documents - even into a content page. So doing something like this from your extension will work:
window.content.frames[0].location.href = "chrome://myextension/content/document.xul";
Not sure whether this will help you, depends on what you are trying to achieve.

Resources