Hey I wanted to create a little project, where I show a gif image and when a button is pressed/swiped the next gif image will be loaded and shown.
So I found a site (http://www.funcage.com/gif/?) which shows everytime you refresh the homepage a new gif. My idea was to parse the link of the gif and show it into an webview.
Everything is working but everytime a couple of new gifs are shown, the app size increases about a couple MB’s. I can see this under settings, where it shows the size of Documents and Data, which for my app is increasing. And even when I terminate/close the app, the size keeps the same.
I exported it to an iPhone 5C running the latest iOS version.
Here is the javascript code:
var Observable = require("FuseJS/Observable");
var link = Observable("http://www.google.com");
var split;
var line;
function nextGIF(args){
baseSite.goto("http://www.funcage.com/gif/?");
}
module.exports = {
onPageLoaded : function(res) {
split = "";
split = JSON.parse(res.json).data.split("\n");
line = "nichts :(";
for (i = 0; i < split.length; i++){
line = split[i];
if (line.includes("/gif/m/funnypicture.php?image=../photos/")){
break;
}
}
var start = line.indexOf("/photos/");
var end = line.indexOf("\"", start);
var finalLink = "http://www.funcage.com/gif" + line.substring(start, end);
gifSite.goto(finalLink);
router.goto("next");
},
nextGIF: nextGIF
};
And then in the ux code here is the part, which belongs to the webview
...
<NativeViewHost>
<WebView CachingMode="Never" Opacity="0" ux:Name="baseSite" Layer="Background" Url="http://www.funcage.com/gif/?">
<PageLoaded>
<EvaluateJS Handler="{onPageLoaded}">
var result = {
url : document.location.href,
data : document.body.innerHTML
};
return result;
</EvaluateJS>
</PageLoaded>
</WebView>
</NativeViewHost>
<NativeViewHost>
<WebView CachingMode="Never" ClipToBounds="true" ux:Name="gifSite" Url="http://www.funcage.com/gif/photos/birds-are-assholes.gif" Dock="Fill">
</WebView>
</NativeViewHost>
...
What is going on here? Is he saving all the pages on my iPhone?
Fuse version 0.23.0 (build 7041)