[F/OS] 📁 HtmlLoader - Load HTML Content Without Uploading HTML Files!

:computer: Introduction

A non-visible extension that loads HTML content inside of a WebViewer.

I made this open source version of ✨ [Free] NoFileHtml - view html without files, I just want to use this extension for learning. The code was referenced from this Stack Overflow answer. Free to modify. Thank you!

:date: Release date: 2022-03-03T01:00:00Z

:package: Package name: com.gordonlu.htmlloader.aix

:+1: BIG thanks to: @TIMAI2

:book: Documentation

ClearHtmlContent

image

Clears the content loaded in the given WebViewer. Note that it also clears all content, even the HomeUrl, of the WebViewer.

Parameters: webViewer = component

LoadHtmlContent

image

Loads the HTML content inside of the WebViewer. If you have already loaded HTML content, it will replace the former HTML content with this current content.

Parameters: webViewer = component, content = text

What can the LoadHtmlContent method load?

These are accepted.

image

These are also accepted.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>
<!DOCTYPE html>
<html>
<body>

<h1>The Window Object</h1>
<h2>The open() Method</h2>

<p>Click the button to open a new browser window.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
  window.open("https://www.w3schools.com");
}
</script>

</body>
</html>

Taken from here and here.

:inbox_tray: Downloads

TXT: HtmlLoader.txt (2.1 KB)

AIX: com.gordonlu.htmlloader.aix (6.1 KB)

:heavy_check_mark: Tests

Works exactly as what it should be in the companion of Xiaomi 11 5G NE and App Inventor aiStarter emulator.

:+1: Rate my extension! :-1:

  • Good extension!
  • Bad extension.
0 voters

Made with Niotron IDE.

Kindly :email: PM me if you have any questions! Also, if you like my extension, please :heart: like it! It takes some effort for me to make it...

Votes and likes tell me the general user feedback of my extension. If you read this extension, please take 20 seconds to drop by and give a vote / like!

If you have any features that you want to add and you know the code, PM me.


Gordon Lu

:speech_balloon: Message :earth_africa: Website :e-mail: E-mail

10 Likes

Great work :+1:t2::+1:t2:

2 Likes

Outstanding extension! :heart:

1 Like

Updated main post just now. Please check it. Thank you!

I haven't tested it on built app, I'm still checking it.

1 Like

Amazing ! Never thought that this can happen too :grinning:

PS: I actually didn't knew how to do it :sweat_smile:

1 Like

Thank you all for your support!

2 Likes

we have helped you because you have done great and fantastic work, and will keep supporting you :heart_eyes:

2 Likes

Great implementation.

Just a small, possibly irrelevant question; but would it be more convenient to load an extension into the program rather than uploading actual HTML files into the program? Opening the file may be a bit tedious, but would it be more tedious than opening it through your extension?

Quick side note: this query comes from a person who has no experience in file management.

1 Like

No, of course, I suggest the file way. But if in some circumstances, you cannot use the file but you have to load it via text blocks, an extension is the only way to go.

1 Like

Great extension actually , at least you already have all your code inside and embedded in the apk and java code not in a separate HTML document in assets folder

1 Like

I got a new phone (Andorid 11) and webviewer not loading html files from inner store. Sofar it worked well on older phones. Eg. http://localhost/mszamla.html not loading with "404. Not found" error.

You have to copy the HTML code and then use it for the content.

1 Like

why the extension doesn't load JS code?

This is HTML and not JavaScript. Search the forum to see how to run JavaScript. There are lots of examples.

ok, I got it thanks

Excelent extension, thnak you!