Local Webpage Embedded Incorrectly (LWEI)

ECn Categories > Browser Embedded Incorrectly (BEI) > Local Webpage Embedded Incorrectly (LWEI)

The app redirects the user to an activity with an embedded web page from a local file and it does not works because it has no internet connection.

Amount of Issues App List
1 (A18) FBReader

Examples

FBReader

Category: Books and reference books
v 2.8.2
Scenario: To see the content in the main view without internet connection
This video shows an example of a local website embeded incorrectly. At 3rd second the user starts navigation in the application, from the beggining there are some blank spaces from some images. Due to connectionless state this images are not shown and the links that comes with them to download more e-books.

The following code snippets show the classes and files that are involved in the generation of the previuos issue.

In order to see how this error is generated, we need to review all the flow event. First, we have the job in charge of creating the starting view for the user, we can see at line 59 that the “generate.py” file is executed with some arguments, the most important is the second one at line 61 that is a folder path where some html files that are used for the first view are stored.

build.xml

    <target name="genhelp">
59. 	<exec executable="./help/generate.py">
			<arg value="help/proto"/>
61. 		<arg value="help/html"/>
			<arg value="assets/data/intro"/>
		</exec>
	</target>

Second, in the main method of the “generate.py” file, the arguments are stored in variables at line 54 the method stores the html folder path in the “html_dir” variable that will be used at line 63 where the “generate_epub” method is called, this method is called for each file that is in the folder.

help/generate.py

    if __name__ == '__main__':
        if len(sys.argv) != 4:
            exit('Usage: %s <proto_dir> <html_dir> <output_dir>' % sys.argv[0])

        proto_dir = sys.argv[1]
54.     html_dir = sys.argv[2]
        output_dir = sys.argv[3]

        os.makedirs(output_dir)
        for lang in collect_languages(html_dir):
            epub = os.path.join(output_dir, 'intro-' + lang + '.epub')
            if os.path.exists(epub):
                os.remove(epub)
            print 'Generating intro for language %s...' % lang
63.         generate_epub(proto_dir, html_dir, epub, lang)

So, when we see inside each file we can see that the information displayed to the user is defined in this html files and as it can be seen at line 10 is retrieving the images

help/html/en_US.html

10. <p class='opds last'><fbreader:opds size='5' src='https://data.fbreader.org/recommended/default/catalog.xml'/></p>