1

So the goal is - I have a web page, and I want to embed it in a webview in an android app, but I need this page working offline. So I came to a solution to save the whole page with all files, I tried Save As in Chrome, I've tried about 10 different programs like HTTrack and NColector etc, but the problem is - in an html file there is something like this

 <script src="js/blabla.js"></script>
<script>
require(["js/some_config.js"], function(config) {

    require(['one_more_js'], function(one_more_js) {

        require(['one_more_js_here'], function(app) {
            app.init(...

So blabla.js is fine, HTTrack does download this resource, but there are lots of other files (mp3, images, js, etc) that are loading inside of these other scripts, after initialization, and there are links pointing on media resources inside of "one_more_js_here" , so it isn't being downloaded by HTTrack and other programms.

I tried to download every source file manually (it's almost getting me insane), there are too many dependencies, files.. Please, maybe somebody faced this problem before?

(yes, I searched on this site, google, even bing.. I never came here if I wasn't so desperate, thank you for your kindness and brains :))

Noni
  • 11
  • 2
  • 1
    Welcome to StackOverflow! It looks like you're asking how to download someone **else's** website, and use it from within your own offline app. You would need to carefully work out the physical path to each file on the target, and **download each file individually** (assuming legality), then reference the files **locally**. You would also need to [**do some research**](http://meta.stackoverflow.com/questions/261592) about how to reference the files that you have downloaded, and learn the [**basics of Android development**](https://developer.android.com/training/basics/firstapp/index.html). – Obsidian Age Mar 28 '17 at 21:14
  • @ObsidianAge thank you for your comment! yes, I'm working on it now, saving all files and changing paths, I just wondered if it's possible to do it more automatically – Noni Mar 29 '17 at 08:48
  • Hi, how dependent are you on assets loaded by script? Do they make ajax calls to service endpoints and then generate html based on responses? Any other images or files loaded by script? You can get around it to an extent, but for ajax calls it will certainly get tricky. You would have to modify the code at the point it makes the query to instead return to a response you have already collected without doing the query. If it's jquery, then you can just wrap $.ajax to return a promise and resolve it immediately with a pre-collected service response. – Shane Jul 04 '18 at 23:44

0 Answers0